01: package com.bm.ejb3metadata.annotations.impl;
02:
03: import java.lang.annotation.Annotation;
04:
05: import javax.ejb.Remove;
06:
07: /**
08: * Acts as an implementation of @{@link javax.ejb.Remove} annotation.
09: * @author Daniel Wiese
10: */
11: public class JRemove implements Remove {
12:
13: /**
14: * Don't remove object if there is an application exception.
15: */
16: private boolean retainIfException = false;
17:
18: /**
19: * Build an object which represents@{@link javax.ejb.Remove}.<br>
20: * Default value for retainIfException is false.
21: */
22: public JRemove() {
23: this (false);
24: }
25:
26: /**
27: * Build an object which represents@{@link javax.ejb.Remove} with a
28: * given boolean.
29: * @param retainIfException true/false (false is a default value)
30: */
31: public JRemove(final boolean retainIfException) {
32: this .retainIfException = retainIfException;
33: }
34:
35: /**
36: * @return the retainIfException value (true/false).
37: */
38: public boolean retainIfException() {
39: return retainIfException;
40: }
41:
42: /**
43: * @return annotation type.
44: */
45: public Class<? extends Annotation> annotationType() {
46: return Remove.class;
47: }
48:
49: /**
50: * @return string representation.
51: */
52: @Override
53: public String toString() {
54: StringBuilder sb = new StringBuilder();
55: // classname
56: sb.append(this .getClass().getName().substring(
57: this .getClass().getPackage().getName().length() + 1));
58: // retainIfException
59: sb.append("[retainIfException=");
60: sb.append(retainIfException);
61:
62: sb.append("]");
63: return sb.toString();
64: }
65: }
|