Top Description Fields Constructors Methods
net.bytebuddy.jar.asm

public abstract Class AnnotationVisitor

extends Object
Class Inheritance
Known Direct Subclasses
net.bytebuddy.jar.asm.AnnotationWriter, net.bytebuddy.jar.asm.commons.AnnotationRemapper, net.bytebuddy.pool.TypePool.Default.TypeExtractor.AnnotationExtractor, net.bytebuddy.asm.TypeReferenceAdjustment.TypeReferenceClassVisitor.TypeReferenceAnnotationVisitor

A visitor to visit a Java annotation. The methods of this class must be called in the following order: ( visit | visitEnum | visitAnnotation | visitArray )* visitEnd.
Authors
Eric Bruneton, Eugene Kuleshov

Field Summary

Modifier and TypeField and Description
protected final int
api

The ASM API version implemented by this visitor.

protected AnnotationVisitor
av

The annotation visitor to which this visitor must delegate method calls.

Constructor Summary

AccessConstructor and Description
protected
AnnotationVisitor(final int
the ASM API version implemented by this visitor. Must be one of the ASMx values in Opcodes.
api
)

Constructs a new AnnotationVisitor.

protected
AnnotationVisitor(final int
the ASM API version implemented by this visitor. Must be one of the ASMx values in Opcodes.
api
,
final AnnotationVisitor
the annotation visitor to which this visitor must delegate method calls. May be null.
annotationVisitor
)

Constructs a new AnnotationVisitor.

Method Summary

Modifier and TypeMethod and Description
public AnnotationVisitor

Returns:

the annotation visitor to which this visitor must delegate method calls, or null.
getDelegate
()

The annotation visitor to which this visitor must delegate method calls.

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
)

Visits a primitive value of the annotation.

public AnnotationVisitor

Returns:

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.
visitAnnotation
(final String
the value name.
name
,
final String
the class descriptor of the nested annotation class.
descriptor
)

Visits a nested annotation value of the annotation.

public AnnotationVisitor

Returns:

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.
visitArray
(final String
the value name.
name
)

Visits an array value of the annotation.

public void
visitEnd()

Visits the end of the annotation.

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
)

Visits an enumeration value of the annotation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

apiback to summary
protected final int api

The ASM API version implemented by this visitor. The value of this field must be one of the ASMx values in Opcodes.

avback to summary
protected AnnotationVisitor av

The annotation visitor to which this visitor must delegate method calls. May be null.

Constructor Detail

AnnotationVisitorback to summary
protected AnnotationVisitor(final int api)

Constructs a new AnnotationVisitor.

Parameters
api:int

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

AnnotationVisitorback to summary
protected AnnotationVisitor(final int api, final AnnotationVisitor annotationVisitor)

Constructs a new AnnotationVisitor.

Parameters
api:int

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

annotationVisitor:AnnotationVisitor

the annotation visitor to which this visitor must delegate method calls. May be null.

Method Detail

getDelegateback to summary
public AnnotationVisitor getDelegate()

The annotation visitor to which this visitor must delegate method calls. May be null.

Returns:AnnotationVisitor

the annotation visitor to which this visitor must delegate method calls, or null.

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

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).

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

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.

visitArrayback to summary
public AnnotationVisitor visitArray(final String name)

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.

visitEndback to summary
public void visitEnd()

Visits the end of the annotation.

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

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.