1 25 26 package org.objectweb.easybeans.deployment.annotations.analyzer.classes; 27 28 import java.util.ArrayList ; 29 import java.util.List ; 30 31 import org.objectweb.easybeans.deployment.annotations.analyzer.JavaxEjbEJBVisitor; 32 import org.objectweb.easybeans.deployment.annotations.impl.JEjbEJB; 33 import org.objectweb.easybeans.deployment.annotations.metadata.ClassAnnotationMetadata; 34 35 39 public class JavaxEjbEJBsVisitor extends JavaxEjbEJBVisitor<ClassAnnotationMetadata> { 40 41 44 public static final String TYPE = "Ljavax/ejb/EJBs;"; 45 46 49 private List <JEjbEJB> jEjbEJBs = null; 50 51 54 private boolean isAdded = false; 55 56 60 public JavaxEjbEJBsVisitor(final ClassAnnotationMetadata annotationMetadata) { 61 super(annotationMetadata); 62 jEjbEJBs = new ArrayList <JEjbEJB>(); 63 } 64 65 73 @Override 74 public void visit(final String name, final Object value) { 75 if (jEjbEJBs.size() > 0 && isAdded) { 78 setJEjbEJB(new JEjbEJB()); 79 isAdded = false; 80 } 81 82 super.visit(name, value); 84 } 85 86 90 @Override 91 public void visitEnd() { 92 if (!isAdded) { 94 jEjbEJBs.add(getJEjbEJB()); 95 isAdded = true; 96 } 97 98 getAnnotationMetadata().setJEjbEJBs(jEjbEJBs); 100 } 101 102 105 @Override 106 public String getType() { 107 return TYPE; 108 } 109 110 } 111 | Popular Tags |