01: package com.bm.ejb3metadata.annotations.analyzer.method;
02:
03: import com.bm.ejb3metadata.annotations.analyzer.AbsAnnotationVisitor;
04: import com.bm.ejb3metadata.annotations.analyzer.AnnotationType;
05: import com.bm.ejb3metadata.annotations.metadata.MethodAnnotationMetadata;
06:
07: /**
08: * This class manages the handling of @{@link javax.interceptor.AroundInvoke}
09: * annotation.
10: * @author Daniel Wiese
11: */
12: public class JavaxInterceptorAroundInvokeVisitor extends
13: AbsAnnotationVisitor<MethodAnnotationMetadata> implements
14: AnnotationType {
15:
16: /**
17: * Type of annotation.
18: */
19: public static final String TYPE = "Ljavax/interceptor/AroundInvoke;";
20:
21: /**
22: * Constructor.
23: * @param methodAnnotationMetadata linked to a method metadata.
24: */
25: public JavaxInterceptorAroundInvokeVisitor(
26: final MethodAnnotationMetadata methodAnnotationMetadata) {
27: super (methodAnnotationMetadata);
28: }
29:
30: /**
31: * Visits the end of the annotation.<br>
32: * Creates the object and store it.
33: */
34: @Override
35: public void visitEnd() {
36: // set flag on method
37: getAnnotationMetadata().setAroundInvoke(true);
38:
39: // set around method on super class
40: getAnnotationMetadata().getClassAnnotationMetadata()
41: .addAroundInvokeMethodMetadata(getAnnotationMetadata());
42:
43: }
44:
45: /**
46: * @return type of the annotation (its description)
47: */
48: public String getType() {
49: return TYPE;
50: }
51:
52: }
|