1 25 26 package org.objectweb.easybeans.deployment.annotations.analyzer; 27 28 import static javax.ejb.TransactionAttributeType.MANDATORY ; 29 import static javax.ejb.TransactionAttributeType.REQUIRED ; 30 import static javax.ejb.TransactionAttributeType.REQUIRES_NEW ; 31 import static javax.ejb.TransactionAttributeType.SUPPORTS ; 32 import static javax.ejb.TransactionAttributeType.NOT_SUPPORTED ; 33 import static javax.ejb.TransactionAttributeType.NEVER ; 34 35 import org.objectweb.easybeans.deployment.annotations.metadata.interfaces.ITransactionAttribute; 36 37 42 public class JavaxEjbTransactionAttributeVisitor<T extends ITransactionAttribute> 43 extends EnumAnnotationVisitor<T> implements AnnotationType { 44 45 48 public static final String TYPE = "Ljavax/ejb/TransactionAttribute;"; 49 50 54 public JavaxEjbTransactionAttributeVisitor(final T annotationMetadata) { 55 super(annotationMetadata); 56 } 57 58 62 @Override 63 public void visitEnd() { 64 String s = getValue(); 65 if (getAnnotationMetadata() != null) { 67 if (MANDATORY.name().equals(s)) { 68 getAnnotationMetadata().setTransactionAttributeType(MANDATORY); 69 } else if (REQUIRED.name().equals(s)) { 70 getAnnotationMetadata().setTransactionAttributeType(REQUIRED); 71 } else if (REQUIRES_NEW.name().equals(s)) { 72 getAnnotationMetadata().setTransactionAttributeType(REQUIRES_NEW); 73 } else if (SUPPORTS.name().equals(s)) { 74 getAnnotationMetadata().setTransactionAttributeType(SUPPORTS); 75 } else if (NOT_SUPPORTED.name().equals(s)) { 76 getAnnotationMetadata().setTransactionAttributeType(NOT_SUPPORTED); 77 } else if (NEVER.name().equals(s)) { 78 getAnnotationMetadata().setTransactionAttributeType(NEVER); 79 } else { 80 getAnnotationMetadata().setTransactionAttributeType(REQUIRED); 82 } 83 } 84 } 85 86 89 public String getType() { 90 return TYPE; 91 } 92 93 } 94 | Popular Tags |