org.objectweb.easybeans.deployment.annotations.analyzer
Class JavaxPersistencePersistenceContextVisitor<T extends IPersistenceContext>

java.lang.Object
  extended by org.objectweb.easybeans.deployment.annotations.analyzer.AbsAnnotationVisitor<T>
      extended by org.objectweb.easybeans.deployment.annotations.analyzer.JavaxPersistencePersistenceContextVisitor<T>
Type Parameters:
T - An implementation of IPersistenceContext interface.
All Implemented Interfaces:
org.objectweb.asm.AnnotationVisitor, AnnotationType
Direct Known Subclasses:
JavaxPersistencePersistenceContextsVisitor

public class JavaxPersistencePersistenceContextVisitor<T extends IPersistenceContext>
extends AbsAnnotationVisitor<T>
implements AnnotationType

This class manages the handling of @PersistenceContext annotation.

Author:
Florent Benoit

Field Summary
private  JavaxPersistenceContext javaxPersistenceContext
          Persistence context information.
private static java.lang.String NAME
          name attribute of the annotation.
private static java.lang.String PERSISTENCECONTEXT_TTRANSACTION_TYPE
          Transaction type.
private static java.lang.String PERSISTENCECONTEXT_TYPE
          Persistence Context type attribute of the annotation.
static java.lang.String TYPE
          Type of annotation.
private static java.lang.String UNIT_NAME
          UnitName attribute of the annotation.
 
Constructor Summary
JavaxPersistencePersistenceContextVisitor(T annotationMetadata)
          Constructor.
 
Method Summary
protected  JavaxPersistenceContext getJavaxPersistenceContext()
           
 java.lang.String getType()
           
protected  void setJavaxPersistenceContext(JavaxPersistenceContext javaxPersistenceContext)
          Sets the javaxPersistenceContext object.
 void visit(java.lang.String name, java.lang.Object value)
          Visits a primitive value of the annotation.
 void visitEnd()
          Visits the end of the annotation.
Creates the object and store it.
 void visitEnum(java.lang.String name, java.lang.String desc, java.lang.String value)
          Visits an enumeration value of the annotation.
 
Methods inherited from class org.objectweb.easybeans.deployment.annotations.analyzer.AbsAnnotationVisitor
getAnnotationMetadata, visitAnnotation, visitArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final java.lang.String TYPE
Type of annotation.

See Also:
Constant Field Values

NAME

private static final java.lang.String NAME
name attribute of the annotation.

See Also:
Constant Field Values

UNIT_NAME

private static final java.lang.String UNIT_NAME
UnitName attribute of the annotation.

See Also:
Constant Field Values

PERSISTENCECONTEXT_TYPE

private static final java.lang.String PERSISTENCECONTEXT_TYPE
Persistence Context type attribute of the annotation.

See Also:
Constant Field Values

PERSISTENCECONTEXT_TTRANSACTION_TYPE

private static final java.lang.String PERSISTENCECONTEXT_TTRANSACTION_TYPE
Transaction type.

See Also:
Constant Field Values

javaxPersistenceContext

private JavaxPersistenceContext javaxPersistenceContext
Persistence context information.

Constructor Detail

JavaxPersistencePersistenceContextVisitor

public JavaxPersistencePersistenceContextVisitor(T annotationMetadata)
Constructor.

Parameters:
annotationMetadata - linked to a class or method or field metadata
Method Detail

visit

public void visit(java.lang.String name,
                  java.lang.Object value)
Visits a primitive value of the annotation.

Specified by:
visit in interface org.objectweb.asm.AnnotationVisitor
Overrides:
visit in class AbsAnnotationVisitor<T extends IPersistenceContext>
Parameters:
name - the value name.
value - the actual value, whose type must be Byte, Boolean, Character, Short, Integer, Long, Float, Double, String or Type.

visitEnum

public void visitEnum(java.lang.String name,
                      java.lang.String desc,
                      java.lang.String value)
Visits an enumeration value of the annotation.

Specified by:
visitEnum in interface org.objectweb.asm.AnnotationVisitor
Overrides:
visitEnum in class AbsAnnotationVisitor<T extends IPersistenceContext>
Parameters:
name - the value name.
desc - the class descriptor of the enumeration class.
value - the actual enumeration value.

getJavaxPersistenceContext

protected JavaxPersistenceContext getJavaxPersistenceContext()
Returns:
Internal object used representing @PersistenceContext annotation.

setJavaxPersistenceContext

protected void setJavaxPersistenceContext(JavaxPersistenceContext javaxPersistenceContext)
Sets the javaxPersistenceContext object.

Parameters:
javaxPersistenceContext - the object which replaced the previous one.

visitEnd

public void visitEnd()
Visits the end of the annotation.
Creates the object and store it.

Specified by:
visitEnd in interface org.objectweb.asm.AnnotationVisitor
Specified by:
visitEnd in class AbsAnnotationVisitor<T extends IPersistenceContext>

getType

public java.lang.String getType()
Specified by:
getType in interface AnnotationType
Returns:
type of the annotation (its description)