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 class
An annotation visitor that collects all type references.protected class
A field visitor that collects all type references.protected class
A 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.AnnotationVisitor
Indicates that an annotation is not of interest.private static final org.objectweb.asm.FieldVisitor
Indicates that a field is not of interest.private static final org.objectweb.asm.MethodVisitor
Indicates that a method is not of interest.A set of inner class names that have been observed within the processed class file.private final boolean
true
if the visitor should throw an exception if a type reference cannot be located.private final TypePool
The 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
ConstructorsModifierConstructorDescriptionprotected
TypeReferenceClassVisitor
(org.objectweb.asm.ClassVisitor classVisitor, boolean strict, ElementMatcher<? super TypeDescription> filter, TypePool typePool) Creates a type reference class visitor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Resolves all type references that are referenced by any ASM constant value.protected void
resolve
(org.objectweb.asm.ConstantDynamic constant) Resolves all type references that are referenced by aConstantDynamic
value.protected void
resolve
(org.objectweb.asm.Handle handle) Resolves all type references that are referenced by aHandle
value.protected void
resolve
(org.objectweb.asm.Type type) Resolves all type references that are referenced by aType
value.protected void
resolveInternalName
(String internalName) Resolves an internal name to its element type.void
visit
(int version, int modifiers, String internalName, String genericSignature, String superClassInternalName, String[] interfaceInternalName) org.objectweb.asm.AnnotationVisitor
visitAnnotation
(String descriptor, boolean visible) void
visitEnd()
org.objectweb.asm.FieldVisitor
visitField
(int modifiers, String name, String descriptor, String signature, Object defaultValue) void
visitInnerClass
(String internalName, String outerName, String innerName, int modifiers) org.objectweb.asm.MethodVisitor
visitMethod
(int modifiers, String internalName, String descriptor, String signature, String[] exceptionInternalName) void
visitNestHost
(String nestHost) void
visitNestMember
(String nestMember) void
visitOuterClass
(String ownerTypeInternalName, String methodName, String methodDescriptor) org.objectweb.asm.RecordComponentVisitor
visitRecordComponent
(String name, String descriptor, String signature) org.objectweb.asm.AnnotationVisitor
visitTypeAnnotation
(int typeReference, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible) Methods inherited from class org.objectweb.asm.ClassVisitor
visitAttribute, visitModule, visitPermittedSubclass, visitSource
-
Field Details
-
IGNORE_ANNOTATION
private static final org.objectweb.asm.AnnotationVisitor IGNORE_ANNOTATIONIndicates that an annotation is not of interest. -
IGNORE_FIELD
private static final org.objectweb.asm.FieldVisitor IGNORE_FIELDIndicates that a field is not of interest. -
IGNORE_METHOD
private static final org.objectweb.asm.MethodVisitor IGNORE_METHODIndicates that a method is not of interest. -
strict
private final boolean stricttrue
if 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
-true
if the visitor should throw an exception if a type reference cannot be located.strict
-true
if 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, String genericSignature, String superClassInternalName, String[] interfaceInternalName) - Overrides:
visit
in classorg.objectweb.asm.ClassVisitor
-
visitNestHost
- Overrides:
visitNestHost
in classorg.objectweb.asm.ClassVisitor
-
visitOuterClass
public void visitOuterClass(String ownerTypeInternalName, String methodName, String methodDescriptor) - Overrides:
visitOuterClass
in classorg.objectweb.asm.ClassVisitor
-
visitNestMember
- Overrides:
visitNestMember
in classorg.objectweb.asm.ClassVisitor
-
visitInnerClass
- Overrides:
visitInnerClass
in classorg.objectweb.asm.ClassVisitor
-
visitRecordComponent
public org.objectweb.asm.RecordComponentVisitor visitRecordComponent(String name, String descriptor, String signature) - Overrides:
visitRecordComponent
in classorg.objectweb.asm.ClassVisitor
-
visitAnnotation
- Overrides:
visitAnnotation
in classorg.objectweb.asm.ClassVisitor
-
visitTypeAnnotation
public org.objectweb.asm.AnnotationVisitor visitTypeAnnotation(int typeReference, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible) - Overrides:
visitTypeAnnotation
in classorg.objectweb.asm.ClassVisitor
-
visitField
public org.objectweb.asm.FieldVisitor visitField(int modifiers, String name, String descriptor, String signature, Object defaultValue) - Overrides:
visitField
in classorg.objectweb.asm.ClassVisitor
-
visitMethod
public org.objectweb.asm.MethodVisitor visitMethod(int modifiers, String internalName, String descriptor, String signature, String[] exceptionInternalName) - Overrides:
visitMethod
in classorg.objectweb.asm.ClassVisitor
-
visitEnd
public void visitEnd()- Overrides:
visitEnd
in classorg.objectweb.asm.ClassVisitor
-
resolve
protected void resolve(org.objectweb.asm.Type type) Resolves all type references that are referenced by aType
value.- Parameters:
type
- The type to resolve.
-
resolve
protected void resolve(org.objectweb.asm.Handle handle) Resolves all type references that are referenced by aHandle
value.- Parameters:
handle
- The handle to resolve.
-
resolve
protected void resolve(org.objectweb.asm.ConstantDynamic constant) Resolves all type references that are referenced by aConstantDynamic
value.- Parameters:
constant
- The dynamic constant to resolve.
-
resolveInternalName
Resolves an internal name to its element 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.
-