Package net.bytebuddy.asm
Class TypeReferenceAdjustment.TypeReferenceClassVisitor
java.lang.Object
org.objectweb.asm.ClassVisitor
net.bytebuddy.asm.TypeReferenceAdjustment.TypeReferenceClassVisitor
- Enclosing class:
TypeReferenceAdjustment
protected static class TypeReferenceAdjustment.TypeReferenceClassVisitor
extends org.objectweb.asm.ClassVisitor
A class visitor that collects all type references and all inner class references.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classAn annotation visitor that collects all type references.protected classA field visitor that collects all type references.protected classA method visitor that collects all type references. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ElementMatcher<? super TypeDescription> A filter for excluding types from type reference analysis.private static final org.objectweb.asm.AnnotationVisitorIndicates that an annotation is not of interest.private static final org.objectweb.asm.FieldVisitorIndicates that a field is not of interest.private static final org.objectweb.asm.MethodVisitorIndicates that a method is not of interest.A set of inner class names that have been observed within the processed class file.private final booleantrueif the visitor should throw an exception if a type reference cannot be located.private final TypePoolThe type pool to use for locating types.A set of inner class names that were added as inner class attribute values.Fields inherited from class org.objectweb.asm.ClassVisitor
api, cv -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTypeReferenceClassVisitor(org.objectweb.asm.ClassVisitor classVisitor, boolean strict, ElementMatcher<? super TypeDescription> filter, TypePool typePool) Creates a type reference class visitor. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidobserveInternalName(String internalName) Observes an internal name of an object type that might be an array type.protected voidResolves all type references that are referenced by any ASM constant value.protected voidresolve(org.objectweb.asm.ConstantDynamic constant) Resolves all type references that are referenced by aConstantDynamicvalue.protected voidresolve(org.objectweb.asm.Handle handle) Resolves all type references that are referenced by aHandlevalue.protected voidresolve(org.objectweb.asm.Type type) Resolves all type references that are referenced by aTypevalue.voidvisit(int version, int modifiers, String internalName, String genericSignature, String superClassInternalName, String[] interfaceInternalName) org.objectweb.asm.AnnotationVisitorvisitAnnotation(String descriptor, boolean visible) voidvisitEnd()org.objectweb.asm.FieldVisitorvisitField(int modifiers, String name, String descriptor, String signature, Object value) voidvisitInnerClass(String internalName, String outerName, String innerName, int modifiers) org.objectweb.asm.MethodVisitorvisitMethod(int modifiers, String internalName, String descriptor, String signature, String[] exceptionInternalName) voidvisitNestHost(String nestHost) voidvisitNestMember(String nestMember) voidvisitOuterClass(String ownerTypeInternalName, String methodName, String methodDescriptor) org.objectweb.asm.RecordComponentVisitorvisitRecordComponent(String name, String descriptor, String signature) org.objectweb.asm.AnnotationVisitorvisitTypeAnnotation(int typeReference, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible) Methods inherited from class org.objectweb.asm.ClassVisitor
getDelegate, visitAttribute, visitModule, visitPermittedSubclass, visitSource
-
Field Details
-
IGNORE_ANNOTATION
Indicates that an annotation is not of interest. -
IGNORE_FIELD
Indicates that a field is not of interest. -
IGNORE_METHOD
Indicates that a method is not of interest. -
strict
private final boolean stricttrueif the visitor should throw an exception if a type reference cannot be located. -
filter
A filter for excluding types from type reference analysis. -
typePool
The type pool to use for locating types. -
observedTypes
A set of inner class names that have been observed within the processed class file. -
visitedInnerTypes
A set of inner class names that were added as inner class attribute values.
-
-
Constructor Details
-
TypeReferenceClassVisitor
protected TypeReferenceClassVisitor(org.objectweb.asm.ClassVisitor classVisitor, boolean strict, ElementMatcher<? super TypeDescription> filter, TypePool typePool) Creates a type reference class visitor.- Parameters:
classVisitor-trueif the visitor should throw an exception if a type reference cannot be located.strict-trueif the visitor should throw an exception if a type reference cannot be located.filter- A filter for excluding types from type reference analysis.typePool- The type pool to use for locating types.
-
-
Method Details
-
visit
public void visit(int version, int modifiers, String internalName, @MaybeNull String genericSignature, @MaybeNull String superClassInternalName, @MaybeNull String[] interfaceInternalName) - Overrides:
visitin classorg.objectweb.asm.ClassVisitor
-
visitNestHost
- Overrides:
visitNestHostin classorg.objectweb.asm.ClassVisitor
-
visitOuterClass
public void visitOuterClass(String ownerTypeInternalName, String methodName, String methodDescriptor) - Overrides:
visitOuterClassin classorg.objectweb.asm.ClassVisitor
-
visitNestMember
- Overrides:
visitNestMemberin classorg.objectweb.asm.ClassVisitor
-
visitInnerClass
- Overrides:
visitInnerClassin classorg.objectweb.asm.ClassVisitor
-
visitRecordComponent
@MaybeNull public org.objectweb.asm.RecordComponentVisitor visitRecordComponent(String name, String descriptor, @MaybeNull String signature) - Overrides:
visitRecordComponentin classorg.objectweb.asm.ClassVisitor
-
visitAnnotation
@MaybeNull public org.objectweb.asm.AnnotationVisitor visitAnnotation(String descriptor, boolean visible) - Overrides:
visitAnnotationin classorg.objectweb.asm.ClassVisitor
-
visitTypeAnnotation
@MaybeNull public org.objectweb.asm.AnnotationVisitor visitTypeAnnotation(int typeReference, @MaybeNull org.objectweb.asm.TypePath typePath, String descriptor, boolean visible) - Overrides:
visitTypeAnnotationin classorg.objectweb.asm.ClassVisitor
-
visitField
@MaybeNull public org.objectweb.asm.FieldVisitor visitField(int modifiers, String name, String descriptor, @MaybeNull String signature, @MaybeNull Object value) - Overrides:
visitFieldin classorg.objectweb.asm.ClassVisitor
-
visitMethod
@MaybeNull public org.objectweb.asm.MethodVisitor visitMethod(int modifiers, String internalName, String descriptor, @MaybeNull String signature, @MaybeNull String[] exceptionInternalName) - Overrides:
visitMethodin classorg.objectweb.asm.ClassVisitor
-
visitEnd
public void visitEnd()- Overrides:
visitEndin classorg.objectweb.asm.ClassVisitor
-
resolve
protected void resolve(org.objectweb.asm.Type type) Resolves all type references that are referenced by aTypevalue.- Parameters:
type- The type to resolve.
-
resolve
protected void resolve(org.objectweb.asm.Handle handle) Resolves all type references that are referenced by aHandlevalue.- Parameters:
handle- The handle to resolve.
-
resolve
protected void resolve(org.objectweb.asm.ConstantDynamic constant) Resolves all type references that are referenced by aConstantDynamicvalue.- Parameters:
constant- The dynamic constant to resolve.
-
observeInternalName
Observes an internal name of an object type that might be an array type.- Parameters:
internalName- The internal name to resolve.
-
resolve
Resolves all type references that are referenced by any ASM constant value.- Parameters:
value- The unknown constant value to resolve.
-