01: package com.bm.ejb3metadata.annotations.analyzer.classes;
02:
03: import org.ejb3unit.asm.Type;
04:
05: import com.bm.ejb3metadata.annotations.analyzer.AnnotationType;
06: import com.bm.ejb3metadata.annotations.analyzer.ObjectArrayAnnotationVisitor;
07: import com.bm.ejb3metadata.annotations.impl.JRemote;
08: import com.bm.ejb3metadata.annotations.metadata.ClassAnnotationMetadata;
09:
10: /**
11: * This class manages the handling of @{@link javax.ejb.Remote} annotation.
12: * @author Daniel Wiese
13: */
14: public class JavaxEjbRemoteVisitor extends
15: ObjectArrayAnnotationVisitor<ClassAnnotationMetadata, Type>
16: implements AnnotationType {
17:
18: /**
19: * Type of annotation.
20: */
21: public static final String TYPE = "Ljavax/ejb/Remote;";
22:
23: /**
24: * Constructor.
25: * @param classAnnotationMetadata linked to a class metadata
26: */
27: public JavaxEjbRemoteVisitor(
28: final ClassAnnotationMetadata classAnnotationMetadata) {
29: super (classAnnotationMetadata);
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: JRemote jRemote = new JRemote();
39: for (Type s : getArrayObjects()) {
40: jRemote.addInterface(s.getInternalName());
41: }
42:
43: getAnnotationMetadata().setRemoteInterfaces(jRemote);
44:
45: }
46:
47: /**
48: * @return type of the annotation (its description)
49: */
50: public String getType() {
51: return TYPE;
52: }
53:
54: }
|