01: package com.bm.ejb3metadata.annotations.analyzer.method;
02:
03: import javax.ejb.Remove;
04:
05: import com.bm.ejb3metadata.annotations.analyzer.AnnotationType;
06: import com.bm.ejb3metadata.annotations.analyzer.ObjectAnnotationVisitor;
07: import com.bm.ejb3metadata.annotations.impl.JRemove;
08: import com.bm.ejb3metadata.annotations.metadata.MethodAnnotationMetadata;
09:
10: /**
11: * This class manages the handling of @{@link javax.ejb.Remove} annotation.
12: * @author Daniel Wiese
13: */
14: public class JavaxEjbRemoveVisitor extends
15: ObjectAnnotationVisitor<MethodAnnotationMetadata, Boolean>
16: implements AnnotationType {
17:
18: /**
19: * Type of annotation.
20: */
21: public static final String TYPE = "Ljavax/ejb/Remove;";
22:
23: /**
24: * Constructor.
25: * @param methodAnnotationMetadata linked to a method metadata.
26: */
27: public JavaxEjbRemoveVisitor(
28: final MethodAnnotationMetadata methodAnnotationMetadata) {
29: super (methodAnnotationMetadata);
30: }
31:
32: /**
33: * Visits the end of the annotation.<br>
34: * Creates the object and store it.
35: */
36: @Override
37: public void visitEnd() {
38: Boolean b = getValue();
39:
40: Remove jRemove;
41: // no value --> default value
42: if (b == null) {
43: jRemove = new JRemove();
44: } else {
45: jRemove = new JRemove(b.booleanValue());
46: }
47:
48: getAnnotationMetadata().setRemove(jRemove);
49:
50: }
51:
52: /**
53: * @return type of the annotation (its description)
54: */
55: public String getType() {
56: return TYPE;
57: }
58:
59: }
|