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

public Class CheckFieldAdapter

extends FieldVisitor
Class Inheritance
Imports
org.objectweb.asm.AnnotationVisitor, .Attribute, .FieldVisitor, .Opcodes, .TypePath, .TypeReference

A FieldVisitor that checks that its methods are properly used.
Author
Eric Bruneton

Field Summary

Modifier and TypeField and Description
private boolean
visitEndCalled

Whether the visitEnd method has been called.

Inherited from org.objectweb.asm.FieldVisitor:
apifv

Constructor Summary

AccessConstructor and Description
public
CheckFieldAdapter(final FieldVisitor
the field visitor to which this adapter must delegate calls.
fieldVisitor
)

Constructs a new CheckFieldAdapter.

protected
CheckFieldAdapter(final int
the ASM API version implemented by this visitor. Must be one of the ASMx values in Opcodes.
api
,
final FieldVisitor
the field visitor to which this adapter must delegate calls.
fieldVisitor
)

Constructs a new CheckFieldAdapter.

Method Summary

Modifier and TypeMethod and Description
private void
public AnnotationVisitor
visitAnnotation(final String
the class descriptor of the annotation class.
descriptor
,
final boolean
true if the annotation is visible at runtime.
visible
)

Overrides org.objectweb.asm.FieldVisitor.visitAnnotation.

Visits an annotation of the field.
public void
visitAttribute(final Attribute
an attribute.
attribute
)

Overrides org.objectweb.asm.FieldVisitor.visitAttribute.

Visits a non standard attribute of the field.
public void
visitEnd()

Overrides org.objectweb.asm.FieldVisitor.visitEnd.

Visits the end of the field.
public AnnotationVisitor
visitTypeAnnotation(final int
a reference to the annotated type. The sort of this type reference must be TypeReference#FIELD. See TypeReference.
typeRef
,
final TypePath
the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.
typePath
,
final String
the class descriptor of the annotation class.
descriptor
,
final boolean
true if the annotation is visible at runtime.
visible
)

Overrides org.objectweb.asm.FieldVisitor.visitTypeAnnotation.

Visits an annotation on the type of the field.
Inherited from org.objectweb.asm.FieldVisitor:
getDelegate

Field Detail

visitEndCalledback to summary
private boolean visitEndCalled

Whether the visitEnd method has been called.

Constructor Detail

CheckFieldAdapterback to summary
public CheckFieldAdapter(final FieldVisitor fieldVisitor)

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

Parameters
fieldVisitor:FieldVisitor

the field visitor to which this adapter must delegate calls.

Exceptions
IllegalStateException:
If a subclass calls this constructor.
CheckFieldAdapterback to summary
protected CheckFieldAdapter(final int api, final FieldVisitor fieldVisitor)

Constructs a new CheckFieldAdapter.

Parameters
api:int

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

fieldVisitor:FieldVisitor

the field visitor to which this adapter must delegate calls.

Method Detail

checkVisitEndNotCalledback to summary
private void checkVisitEndNotCalled()
visitAnnotationback to summary
public AnnotationVisitor visitAnnotation(final String descriptor, final boolean visible)

Overrides org.objectweb.asm.FieldVisitor.visitAnnotation.

Doc from org.objectweb.asm.FieldVisitor.visitAnnotation.

Visits an annotation of the field.

Parameters
descriptor:String

the class descriptor of the annotation class.

visible:boolean

true if the annotation is visible at runtime.

Returns:AnnotationVisitor

a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.

Annotations
@Override
visitAttributeback to summary
public void visitAttribute(final Attribute attribute)

Overrides org.objectweb.asm.FieldVisitor.visitAttribute.

Doc from org.objectweb.asm.FieldVisitor.visitAttribute.

Visits a non standard attribute of the field.

Parameters
attribute:Attribute

an attribute.

Annotations
@Override
visitEndback to summary
public void visitEnd()

Overrides org.objectweb.asm.FieldVisitor.visitEnd.

Doc from org.objectweb.asm.FieldVisitor.visitEnd.

Visits the end of the field. This method, which is the last one to be called, is used to inform the visitor that all the annotations and attributes of the field have been visited.

Annotations
@Override
visitTypeAnnotationback to summary
public AnnotationVisitor visitTypeAnnotation(final int typeRef, final TypePath typePath, final String descriptor, final boolean visible)

Overrides org.objectweb.asm.FieldVisitor.visitTypeAnnotation.

Doc from org.objectweb.asm.FieldVisitor.visitTypeAnnotation.

Visits an annotation on the type of the field.

Parameters
typeRef:int

a reference to the annotated type. The sort of this type reference must be TypeReference#FIELD. See TypeReference.

typePath:TypePath

the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.

descriptor:String

the class descriptor of the annotation class.

visible:boolean

true if the annotation is visible at runtime.

Returns:AnnotationVisitor

a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.

Annotations
@Override