Top Description Fields Constructors Methods
org.objectweb.asm.util

public Class CheckAnnotationAdapter

extends AnnotationVisitor
Class Inheritance
Imports
org.objectweb.asm.AnnotationVisitor, .Opcodes, .Type

An AnnotationVisitor that checks that its methods are properly used.
Author
Eric Bruneton

Field Summary

Modifier and TypeField and Description
private final boolean
useNamedValue

Whether the values of the visited annotation are named.

private boolean
visitEndCalled

Whether the visitEnd method has been called.

Inherited from org.objectweb.asm.AnnotationVisitor:
apiav

Constructor Summary

AccessConstructor and Description
public
CheckAnnotationAdapter(final AnnotationVisitor annotationVisitor)

pack-priv
CheckAnnotationAdapter(final AnnotationVisitor annotationVisitor, final boolean useNamedValues)

Method Summary

Modifier and TypeMethod and Description
private void
checkName(final String name)

private void
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.objectweb.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.objectweb.asm.AnnotationVisitor.visitAnnotation.

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

Overrides org.objectweb.asm.AnnotationVisitor.visitArray.

Visits an array value of the annotation.
public void
visitEnd()

Overrides org.objectweb.asm.AnnotationVisitor.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
)

Overrides org.objectweb.asm.AnnotationVisitor.visitEnum.

Visits an enumeration value of the annotation.
Inherited from org.objectweb.asm.AnnotationVisitor:
getDelegate

Field Detail

useNamedValueback to summary
private final boolean useNamedValue

Whether the values of the visited annotation are named. AnnotationVisitor instances used for annotation default and annotation arrays use unnamed values.

visitEndCalledback to summary
private boolean visitEndCalled

Whether the visitEnd method has been called.

Constructor Detail

CheckAnnotationAdapterback to summary
public CheckAnnotationAdapter(final AnnotationVisitor annotationVisitor)
CheckAnnotationAdapterback to summary
pack-priv CheckAnnotationAdapter(final AnnotationVisitor annotationVisitor, final boolean useNamedValues)

Method Detail

checkNameback to summary
private void checkName(final String name)
checkVisitEndNotCalledback to summary
private void checkVisitEndNotCalled()
visitback to summary
public void visit(final String name, final Object value)

Overrides org.objectweb.asm.AnnotationVisitor.visit.

Doc from org.objectweb.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.objectweb.asm.AnnotationVisitor.visitAnnotation.

Doc from org.objectweb.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.objectweb.asm.AnnotationVisitor.visitArray.

Doc from org.objectweb.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.objectweb.asm.AnnotationVisitor.visitEnd.

Doc from org.objectweb.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.objectweb.asm.AnnotationVisitor.visitEnum.

Doc from org.objectweb.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