com.bm.ejb3metadata.annotations.analyzer
Class JavaxPersistencePersistenceUnitVisitor<T extends IPersistenceUnit>

java.lang.Object
  extended by com.bm.ejb3metadata.annotations.analyzer.AbsAnnotationVisitor<T>
      extended by com.bm.ejb3metadata.annotations.analyzer.JavaxPersistencePersistenceUnitVisitor<T>
Type Parameters:
T - An implementation of IPersistenceUnit interface.
All Implemented Interfaces:
AnnotationType, org.ejb3unit.asm.jar.AnnotationVisitor
Direct Known Subclasses:
JavaxPersistencePersistenceUnitsVisitor

public class JavaxPersistencePersistenceUnitVisitor<T extends IPersistenceUnit>
extends AbsAnnotationVisitor<T>
implements AnnotationType

This class manages the handling of @PersistenceUnit annotation.

Author:
Daniel Wiese

Field Summary
static java.lang.String TYPE
          Type of annotation.
 
Constructor Summary
JavaxPersistencePersistenceUnitVisitor(T annotationMetadata)
          Constructor.
 
Method Summary
protected  JavaxPersistenceUnit getJavaxPersistenceUnit()
           
 java.lang.String getType()
           
protected  void setjavaxPersistenceUnit(JavaxPersistenceUnit javaxPersistenceUnit)
          Sets the javaxPersistenceUnit 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.
 
Methods inherited from class com.bm.ejb3metadata.annotations.analyzer.AbsAnnotationVisitor
getAnnotationMetadata, visitAnnotation, visitArray, visitEnum
 
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
Constructor Detail

JavaxPersistencePersistenceUnitVisitor

public JavaxPersistencePersistenceUnitVisitor(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.ejb3unit.asm.jar.AnnotationVisitor
Overrides:
visit in class AbsAnnotationVisitor<T extends IPersistenceUnit>
Parameters:
name - the value name.
value - the actual value, whose type must be Byte, Boolean, Character, Short, Integer, Long, Float, Double, String or org.ejb3unit.asm.Type.

getJavaxPersistenceUnit

protected JavaxPersistenceUnit getJavaxPersistenceUnit()
Returns:
Internal object used representing @PersistenceUnit annotation.

setjavaxPersistenceUnit

protected void setjavaxPersistenceUnit(JavaxPersistenceUnit javaxPersistenceUnit)
Sets the javaxPersistenceUnit object.

Parameters:
javaxPersistenceUnit - 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.ejb3unit.asm.jar.AnnotationVisitor
Specified by:
visitEnd in class AbsAnnotationVisitor<T extends IPersistenceUnit>

getType

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


Copyright © 2008. All Rights Reserved.