public abstract class MetadataAwareClassVisitor extends ClassVisitor
api, cv
Modifier | Constructor and Description |
---|---|
protected |
MetadataAwareClassVisitor(int api,
ClassVisitor classVisitor)
Creates a metadata aware class visitor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
onAfterAttributes()
Invoked if the attribute visitation is about to complete.
|
protected void |
onAfterRecordComponents()
Invoked after all record components are visited or none is found.
|
protected void |
onNestHost()
Invoked if the nest host was not visited.
|
protected void |
onOuterType()
Invoked if the outer class was not visited.
|
protected AnnotationVisitor |
onVisitAnnotation(String descriptor,
boolean visible)
An order-sensitive invocation of
ClassVisitor.visitAnnotation(String, boolean) . |
protected void |
onVisitAttribute(Attribute attribute)
An order-sensitive invocation of
ClassVisitor.visitAttribute(Attribute) . |
protected void |
onVisitEnd()
An order-sensitive invocation of
ClassVisitor.visitEnd() . |
protected FieldVisitor |
onVisitField(int modifiers,
String internalName,
String descriptor,
String signature,
Object defaultValue)
An order-sensitive invocation of
ClassVisitor.visitField(int, String, String, String, Object) . |
protected void |
onVisitInnerClass(String name,
String outerName,
String innerName,
int modifiers)
An order-sensitive invocation of
ClassVisitor.visitInnerClass(String, String, String, int) . |
protected MethodVisitor |
onVisitMethod(int modifiers,
String internalName,
String descriptor,
String signature,
String[] exception)
An order-sensitive invocation of
ClassVisitor.visitMethod(int, String, String, String, String[]) . |
protected void |
onVisitNestHost(String nestHost)
An order-sensitive invocation of
ClassVisitor.visitNestHost(String) . |
protected void |
onVisitNestMember(String nestMember)
An order-sensitive invocation of
ClassVisitor.visitNestMember(String) . |
protected void |
onVisitOuterClass(String owner,
String name,
String descriptor)
An order-sensitive invocation of
ClassVisitor.visitOuterClass(String, String, String) . |
protected RecordComponentVisitor |
onVisitRecordComponent(String name,
String descriptor,
String signature)
An order-sensitive invocation of
ClassVisitor.visitRecordComponent(String, String, String) . |
protected AnnotationVisitor |
onVisitTypeAnnotation(int typeReference,
TypePath typePath,
String descriptor,
boolean visible)
An order-sensitive invocation of
ClassVisitor.visitTypeAnnotation(int, TypePath, String, boolean) . |
AnnotationVisitor |
visitAnnotation(String descriptor,
boolean visible) |
void |
visitAttribute(Attribute attribute) |
void |
visitEnd() |
FieldVisitor |
visitField(int modifiers,
String internalName,
String descriptor,
String signature,
Object defaultValue) |
void |
visitInnerClass(String name,
String outerName,
String innerName,
int modifiers) |
MethodVisitor |
visitMethod(int modifiers,
String internalName,
String descriptor,
String signature,
String[] exception) |
void |
visitNestHost(String nestHost) |
void |
visitNestMember(String nestMember) |
void |
visitOuterClass(String owner,
String name,
String descriptor) |
RecordComponentVisitor |
visitRecordComponent(String name,
String descriptor,
String signature) |
AnnotationVisitor |
visitTypeAnnotation(int typeReference,
TypePath typePath,
String descriptor,
boolean visible) |
visit, visitModule, visitPermittedSubtypeExperimental, visitSource
protected MetadataAwareClassVisitor(int api, ClassVisitor classVisitor)
api
- The API version.classVisitor
- The class visitor to delegate to.protected void onNestHost()
protected void onOuterType()
protected void onAfterAttributes()
protected void onAfterRecordComponents()
public final void visitNestHost(String nestHost)
visitNestHost
in class ClassVisitor
protected void onVisitNestHost(String nestHost)
ClassVisitor.visitNestHost(String)
.nestHost
- The internal name of the nest host.public final void visitOuterClass(String owner, String name, String descriptor)
visitOuterClass
in class ClassVisitor
protected void onVisitOuterClass(String owner, String name, String descriptor)
ClassVisitor.visitOuterClass(String, String, String)
.owner
- The outer class's internal name.name
- The outer method's name or null
if it does not exist.descriptor
- The outer method's descriptor or null
if it does not exist.public RecordComponentVisitor visitRecordComponent(String name, String descriptor, String signature)
visitRecordComponent
in class ClassVisitor
protected RecordComponentVisitor onVisitRecordComponent(String name, String descriptor, String signature)
ClassVisitor.visitRecordComponent(String, String, String)
.name
- The record component's name.descriptor
- The record component's descriptor.signature
- The record component's generic signature or null
if the record component's type is non-generic.null
if the component should not be visited.public final AnnotationVisitor visitAnnotation(String descriptor, boolean visible)
visitAnnotation
in class ClassVisitor
protected AnnotationVisitor onVisitAnnotation(String descriptor, boolean visible)
ClassVisitor.visitAnnotation(String, boolean)
.descriptor
- The annotation type's descriptor.visible
- true
if the annotation is visible at runtime.null
if the annotation should be ignored.public final AnnotationVisitor visitTypeAnnotation(int typeReference, TypePath typePath, String descriptor, boolean visible)
visitTypeAnnotation
in class ClassVisitor
protected AnnotationVisitor onVisitTypeAnnotation(int typeReference, TypePath typePath, String descriptor, boolean visible)
ClassVisitor.visitTypeAnnotation(int, TypePath, String, boolean)
.typeReference
- The type reference of the type annotation.typePath
- The type path of the type annotation.descriptor
- The descriptor of the annotation type.visible
- true
if the annotation is visible at runtime.null
if the annotation should be ignored.public final void visitAttribute(Attribute attribute)
visitAttribute
in class ClassVisitor
protected void onVisitAttribute(Attribute attribute)
ClassVisitor.visitAttribute(Attribute)
.attribute
- The attribute to visit.public final void visitNestMember(String nestMember)
visitNestMember
in class ClassVisitor
protected void onVisitNestMember(String nestMember)
ClassVisitor.visitNestMember(String)
.nestMember
- The internal name of the nest member.public final void visitInnerClass(String name, String outerName, String innerName, int modifiers)
visitInnerClass
in class ClassVisitor
protected void onVisitInnerClass(String name, String outerName, String innerName, int modifiers)
ClassVisitor.visitInnerClass(String, String, String, int)
.name
- The internal name of the inner class.outerName
- The internal name of the outer class.innerName
- The inner class's simple name or null
for an anonymous class.modifiers
- The inner class's source code modifiers.public final FieldVisitor visitField(int modifiers, String internalName, String descriptor, String signature, Object defaultValue)
visitField
in class ClassVisitor
protected FieldVisitor onVisitField(int modifiers, String internalName, String descriptor, String signature, Object defaultValue)
ClassVisitor.visitField(int, String, String, String, Object)
.modifiers
- The field's modifiers.internalName
- The field's internal name.descriptor
- The field type's descriptor.signature
- The field's generic signature or null
if the field is not generic.defaultValue
- The field's default value or null
if no such value exists.null
to ignore it.public final MethodVisitor visitMethod(int modifiers, String internalName, String descriptor, String signature, String[] exception)
visitMethod
in class ClassVisitor
protected MethodVisitor onVisitMethod(int modifiers, String internalName, String descriptor, String signature, String[] exception)
ClassVisitor.visitMethod(int, String, String, String, String[])
.modifiers
- The method's modifiers.internalName
- The method's internal name.descriptor
- The field type's descriptor.signature
- The method's generic signature or null
if the method is not generic.exception
- The method's declared exceptions or null
if no exceptions are declared.null
to ignore it.public final void visitEnd()
visitEnd
in class ClassVisitor
protected void onVisitEnd()
ClassVisitor.visitEnd()
.Copyright © 2014–2020. All rights reserved.