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.ObjectAnnotationVisitor;
07: import com.bm.ejb3metadata.annotations.metadata.ClassAnnotationMetadata;
08:
09: /**
10: * This class manages the handling of @{@link javax.ejb.LocalHome} annotation.
11: * @author Daniel Wiese
12: */
13: public class JavaxEjbLocalHomeVisitor extends
14: ObjectAnnotationVisitor<ClassAnnotationMetadata, Type>
15: implements AnnotationType {
16:
17: /**
18: * Type of annotation.
19: */
20: public static final String TYPE = "Ljavax/ejb/LocalHome;";
21:
22: /**
23: * Constructor.
24: * @param classAnnotationMetadata linked to a class metadata
25: */
26: public JavaxEjbLocalHomeVisitor(
27: final ClassAnnotationMetadata classAnnotationMetadata) {
28: super (classAnnotationMetadata);
29: }
30:
31: /**
32: * Visits the end of the annotation.<br> Creates the object and store it.
33: */
34: @Override
35: public void visitEnd() {
36: Type t = getValue();
37: String className = t.getInternalName();
38: getAnnotationMetadata().setLocalHome(className);
39: }
40:
41: /**
42: * @return type of the annotation (its description).
43: */
44: public String getType() {
45: return TYPE;
46: }
47:
48: }
|