Top Description Fields Constructors Methods
org.eclipse.persistence.internal.libraries.asm.tree

public Class AnnotationNode

extends AnnotationVisitor
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.internal.libraries.asm.tree.TypeAnnotationNode
Imports
java.util.ArrayList, .List, org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor, .Opcodes

A node that represents an annotation.
Author
Eric Bruneton

Field Summary

Modifier and TypeField and Description
public String
desc

The class descriptor of the annotation class.

public List<Object>
values

The name value pairs of this annotation.

Inherited from org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor:
apiav

Constructor Summary

AccessConstructor and Description
public
AnnotationNode(final String
the class descriptor of the annotation class.
descriptor
)

Constructs a new AnnotationNode.

public
AnnotationNode(final int
the ASM API version implemented by this visitor. Must be one of the ASMx values in Opcodes.
api
,
final String
the class descriptor of the annotation class.
descriptor
)

Constructs a new AnnotationNode.

pack-priv
AnnotationNode(final List<Object>
where the visited values must be stored.
values
)

Constructs a new AnnotationNode to visit an array value.

Method Summary

Modifier and TypeMethod and Description
public void
accept(final AnnotationVisitor
an annotation visitor. Maybe null.
annotationVisitor
)

Makes the given visitor visit this annotation.

pack-priv static void
accept(final AnnotationVisitor
an annotation visitor. Maybe null.
annotationVisitor
,
final String
the value name.
name
,
final Object
the actual value.
value
)

Makes the given visitor visit a given annotation value.

public void
check(final int
an ASM API version. Must be one of the ASMx values in Opcodes.
api
)

Checks that this annotation node is compatible with the given ASM API version.

public void
visit(final String
the value name.
name
,
final Object
the actual value, whose type must be Byte, Boolean, Character, Short, Integer , Long, Float, Double, String or Type of Type#OBJECT or Type#ARRAY sort. This value can also be an array of byte, boolean, short, char, int, long, float or double values (this is equivalent to using visitArray and visiting each array element in turn, but is more convenient).
value
)

Overrides org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visit.

Visits a primitive value of the annotation.
public AnnotationVisitor
visitAnnotation(final String
the value name.
name
,
final String
the class descriptor of the nested annotation class.
descriptor
)

Overrides org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visitAnnotation.

Visits a nested annotation value of the annotation.
public AnnotationVisitor
visitArray(final String
the value name.
name
)

Overrides org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visitArray.

Visits an array value of the annotation.
public void
public void
visitEnum(final String
the value name.
name
,
final String
the class descriptor of the enumeration class.
descriptor
,
final String
the actual enumeration value.
value
)

Overrides org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visitEnum.

Visits an enumeration value of the annotation.
Inherited from org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor:
getDelegate

Field Detail

descback to summary
public String desc

The class descriptor of the annotation class.

valuesback to summary
public List<Object> values

The name value pairs of this annotation. Each name value pair is stored as two consecutive elements in the list. The name is a String, and the value may be a Byte, Boolean, Character, Short, Integer, Long, Float, Double, String or org.eclipse.persistence.internal.libraries.asm.Type, or a two elements String array (for enumeration values), an AnnotationNode, or a List of values of one of the preceding types. The list may be null if there is no name value pair.

Constructor Detail

AnnotationNodeback to summary
public AnnotationNode(final String descriptor)

Constructs a new AnnotationNode. Subclasses must not use this constructor. Instead, they must use the AnnotationNode(int, String) version.

Parameters
descriptor:String

the class descriptor of the annotation class.

Exceptions
IllegalStateException:
If a subclass calls this constructor.
AnnotationNodeback to summary
public AnnotationNode(final int api, final String descriptor)

Constructs a new AnnotationNode.

Parameters
api:int

the ASM API version implemented by this visitor. Must be one of the ASMx values in Opcodes.

descriptor:String

the class descriptor of the annotation class.

AnnotationNodeback to summary
pack-priv AnnotationNode(final List<Object> values)

Constructs a new AnnotationNode to visit an array value.

Parameters
values:List<Object>

where the visited values must be stored.

Method Detail

acceptback to summary
public void accept(final AnnotationVisitor annotationVisitor)

Makes the given visitor visit this annotation.

Parameters
annotationVisitor:AnnotationVisitor

an annotation visitor. Maybe null.

acceptback to summary
pack-priv static void accept(final AnnotationVisitor annotationVisitor, final String name, final Object value)

Makes the given visitor visit a given annotation value.

Parameters
annotationVisitor:AnnotationVisitor

an annotation visitor. Maybe null.

name:String

the value name.

value:Object

the actual value.

checkback to summary
public void check(final int api)

Checks that this annotation node is compatible with the given ASM API version. This method checks that this node, and all its children recursively, do not contain elements that were introduced in more recent versions of the ASM API than the given version.

Parameters
api:int

an ASM API version. Must be one of the ASMx values in Opcodes.

visitback to summary
public void visit(final String name, final Object value)

Overrides org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visit.

Doc from org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visit.

Visits a primitive value of the annotation.

Parameters
name:String

the value name.

value:Object

the actual value, whose type must be Byte, Boolean, Character, Short, Integer , Long, Float, Double, String or Type of Type#OBJECT or Type#ARRAY sort. This value can also be an array of byte, boolean, short, char, int, long, float or double values (this is equivalent to using visitArray and visiting each array element in turn, but is more convenient).

Annotations
@Override
visitAnnotationback to summary
public AnnotationVisitor visitAnnotation(final String name, final String descriptor)

Overrides org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visitAnnotation.

Doc from org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visitAnnotation.

Visits a nested annotation value of the annotation.

Parameters
name:String

the value name.

descriptor:String

the class descriptor of the nested annotation class.

Returns:AnnotationVisitor

a visitor to visit the actual nested annotation value, or null if this visitor is not interested in visiting this nested annotation. The nested annotation value must be fully visited before calling other methods on this annotation visitor.

Annotations
@Override
visitArrayback to summary
public AnnotationVisitor visitArray(final String name)

Overrides org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visitArray.

Doc from org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visitArray.

Visits an array value of the annotation. Note that arrays of primitive values (such as byte, boolean, short, char, int, long, float or double) can be passed as value to visit. This is what ClassReader does for non empty arrays of primitive values.

Parameters
name:String

the value name.

Returns:AnnotationVisitor

a visitor to visit the actual array value elements, or null if this visitor is not interested in visiting these values. The 'name' parameters passed to the methods of this visitor are ignored. All the array values must be visited before calling other methods on this annotation visitor.

Annotations
@Override
visitEndback to summary
public void visitEnd()

Overrides org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visitEnd.

Doc from org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visitEnd.

Visits the end of the annotation.

Annotations
@Override
visitEnumback to summary
public void visitEnum(final String name, final String descriptor, final String value)

Overrides org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visitEnum.

Doc from org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visitEnum.

Visits an enumeration value of the annotation.

Parameters
name:String

the value name.

descriptor:String

the class descriptor of the enumeration class.

value:String

the actual enumeration value.

Annotations
@Override