01: package com.bm.ejb3metadata.annotations.analyzer;
02:
03: import org.ejb3unit.asm.Type;
04:
05: import com.bm.ejb3metadata.annotations.impl.JInterceptors;
06: import com.bm.ejb3metadata.annotations.metadata.interfaces.IEJBInterceptors;
07:
08: /**
09: * This class manages the handling of @{@link javax.interceptor.Interceptors}
10: * annotation. This can be applied on a Class or on Methods.
11: * @param <T> An implementation of IEJBInterceptors interface.
12: * @author Daniel Wiese
13: */
14: public class JavaxInterceptorInterceptorsVisitor<T extends IEJBInterceptors>
15: extends ObjectArrayAnnotationVisitor<T, Type> implements
16: AnnotationType {
17:
18: /**
19: * Type of annotation.
20: */
21: public static final String TYPE = "Ljavax/interceptor/Interceptors;";
22:
23: /**
24: * Constructor.
25: * @param annotationMetadata linked to a class/method metadata.
26: */
27: public JavaxInterceptorInterceptorsVisitor(
28: final T annotationMetadata) {
29: super (annotationMetadata);
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: JInterceptors jInterceptors = new JInterceptors();
39: for (Type s : getArrayObjects()) {
40: jInterceptors.addClass(s.getInternalName());
41: }
42:
43: getAnnotationMetadata().setAnnotationsInterceptors(
44: jInterceptors);
45:
46: }
47:
48: /**
49: * @return type of the annotation (its description)
50: */
51: public String getType() {
52: return TYPE;
53: }
54:
55: }
|