1 25 26 package org.objectweb.easybeans.deployment.annotations.analyzer; 27 28 import org.objectweb.asm.Type; 29 30 import org.objectweb.easybeans.deployment.annotations.impl.JEjbEJB; 31 import org.objectweb.easybeans.deployment.annotations.metadata.interfaces.IEjbEJB; 32 33 38 public class JavaxEjbEJBVisitor<T extends IEjbEJB> 39 extends AbsAnnotationVisitor<T> implements AnnotationType { 40 41 44 private static final String NAME = "name"; 45 46 49 private static final String BEAN_INTERFACE = "beanInterface"; 50 51 54 private static final String BEAN_NAME = "beanName"; 55 56 59 private static final String MAPPED_NAME = "mappedName"; 60 61 64 public static final String TYPE = "Ljavax/ejb/EJB;"; 65 66 69 private JEjbEJB jEjbEJB = null; 70 71 75 public JavaxEjbEJBVisitor(final T annotationMetadata) { 76 super(annotationMetadata); 77 jEjbEJB = new JEjbEJB(); 78 } 79 80 81 89 @Override 90 public void visit(final String name, final Object value) { 91 if (name.equals(NAME)) { 92 jEjbEJB.setName((String ) value); 93 } else if (name.equals(BEAN_INTERFACE)) { 94 Type type = (Type) value; 95 jEjbEJB.setBeanInterface(type.getClassName()); 96 } else if (name.equals(BEAN_NAME)) { 97 jEjbEJB.setBeanName((String ) value); 98 } else if (name.equals(MAPPED_NAME)) { 99 jEjbEJB.setMappedName((String ) value); 100 } 101 } 102 103 107 @Override 108 public void visitEnd() { 109 getAnnotationMetadata().setJEjbEJB(jEjbEJB); 111 } 112 113 116 public String getType() { 117 return TYPE; 118 } 119 120 121 124 protected JEjbEJB getJEjbEJB() { 125 return jEjbEJB; 126 } 127 128 132 protected void setJEjbEJB(final JEjbEJB jEjbEJB) { 133 this.jEjbEJB = jEjbEJB; 134 } 135 136 } 137 | Popular Tags |