org.objectweb.easybeans.deployment.annotations.analyzer
Class JavaxAnnotationResourceVisitor<T extends IAnnotationResource>

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

public class JavaxAnnotationResourceVisitor<T extends IAnnotationResource>
extends AbsAnnotationVisitor<T>
implements AnnotationType

This class manages the handling of @Resource annotation.

Author:
Florent Benoit

Field Summary
private static java.lang.String AUTHENTICATION_TYPE
          Atuthentication type attribute of the annotation.
private static java.lang.String CLASS_TYPE
          Class with type attribute of the annotation.
private static java.lang.String DESCRIPTION
          Description of the annotation.
private  JAnnotationResource jAnnotationResource
          Internal object used representing @Resource annotation.
private static java.lang.String MAPPED_NAME
          Mapped name attribute of the annotation.
private static java.lang.String NAME
          Name attribute of the annotation.
private static java.lang.String SHAREABLE
          Shareable attribute of the annotation.
static java.lang.String TYPE
          Type of annotation.
 
Constructor Summary
JavaxAnnotationResourceVisitor(T annotationMetadata)
          Constructor.
 
Method Summary
protected  JAnnotationResource getJAnnotationResource()
           
 java.lang.String getType()
           
protected  void setJAnnotationResource(JAnnotationResource jAnnotationResource)
          Sets the jAnnotationResource 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.
 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

NAME

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

See Also:
Constant Field Values

CLASS_TYPE

private static final java.lang.String CLASS_TYPE
Class with type attribute of the annotation.

See Also:
Constant Field Values

AUTHENTICATION_TYPE

private static final java.lang.String AUTHENTICATION_TYPE
Atuthentication type attribute of the annotation.

See Also:
Constant Field Values

SHAREABLE

private static final java.lang.String SHAREABLE
Shareable attribute of the annotation.

See Also:
Constant Field Values

DESCRIPTION

private static final java.lang.String DESCRIPTION
Description of the annotation.

See Also:
Constant Field Values

MAPPED_NAME

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

See Also:
Constant Field Values

TYPE

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

See Also:
Constant Field Values

jAnnotationResource

private JAnnotationResource jAnnotationResource
Internal object used representing @Resource annotation.

Constructor Detail

JavaxAnnotationResourceVisitor

public JavaxAnnotationResourceVisitor(T annotationMetadata)
Constructor.

Parameters:
annotationMetadata - linked to a class or method 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 IAnnotationResource>
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 IAnnotationResource>
Parameters:
name - the value name.
desc - the class descriptor of the enumeration class.
value - the actual enumeration value.

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 IAnnotationResource>

getType

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

getJAnnotationResource

protected JAnnotationResource getJAnnotationResource()
Returns:
Internal object used representing @Resource annotation.

setJAnnotationResource

protected void setJAnnotationResource(JAnnotationResource jAnnotationResource)
Sets the jAnnotationResource object.

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