public class DynamicClassReferenceInitializer extends java.lang.Object implements ClassVisitor, InstructionVisitor, ConstantVisitor, AttributeVisitor
InstructionVisitor
initializes any constant Class.forName
or
.class
references of all classes it visits. More specifically, it fills out the references
of string constant pool entries that refer to a class in the program class pool or in the library
class pool.
It optionally prints notes if on usage of
(SomeClass)Class.forName(variable).newInstance()
.
The class hierarchy must be initialized before using this visitor.
It's more efficient to use as a ClassVisitor
than an InstructionVisitor
.
ClassSuperHierarchyInitializer
Modifier and Type | Field and Description |
---|---|
static int |
A |
static int |
B |
static int |
C |
static int |
D |
static int |
X |
static int |
Y |
static int |
Z |
Constructor and Description |
---|
DynamicClassReferenceInitializer(ClassPool programClassPool,
ClassPool libraryClassPool,
WarningPrinter missingNotePrinter,
WarningPrinter dependencyWarningPrinter,
WarningPrinter notePrinter,
StringMatcher noteExceptionMatcher)
Creates a new DynamicClassReferenceInitializer that optionally prints warnings and notes, with
optional class specifications for which never to print notes.
|
DynamicClassReferenceInitializer(ClassPool programClassPool,
ClassPool libraryClassPool,
WarningPrinter missingNotePrinter,
WarningPrinter dependencyWarningPrinter,
WarningPrinter notePrinter,
StringMatcher noteExceptionMatcher,
ClassVisitor extraClassVisitor)
Creates a new DynamicClassReferenceInitializer that optionally prints warnings and notes, with
optional class specifications for which never to print notes.
|
Modifier and Type | Method and Description |
---|---|
void |
visitAnyAttribute(Clazz clazz,
Attribute attribute)
Visits any Attribute instance.
|
void |
visitAnyClass(Clazz clazz)
Visits any Clazz instance.
|
void |
visitAnyInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
Instruction instruction)
Visits any Instruction instance.
|
void |
visitClassConstant(Clazz clazz,
ClassConstant classConstant)
Prints out a note about the class cast to this class, if applicable.
|
void |
visitCodeAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute) |
void |
visitMethodrefConstant(Clazz clazz,
MethodrefConstant methodrefConstant)
Checks whether the referenced method is a .class method.
|
void |
visitProgramClass(ProgramClass programClass) |
void |
visitStringConstant(Clazz clazz,
StringConstant stringConstant)
Fills out the link to the referenced class.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
visitLibraryClass
visitAnySwitchInstruction, visitBranchInstruction, visitConstantInstruction, visitLookUpSwitchInstruction, visitSimpleInstruction, visitTableSwitchInstruction, visitVariableInstruction
visitAnyConstant, visitAnyMethodrefConstant, visitAnyRefConstant, visitDoubleConstant, visitDynamicConstant, visitFieldrefConstant, visitFloatConstant, visitIntegerConstant, visitInterfaceMethodrefConstant, visitInvokeDynamicConstant, visitLongConstant, visitMethodHandleConstant, visitMethodTypeConstant, visitModuleConstant, visitNameAndTypeConstant, visitPackageConstant, visitPrimitiveArrayConstant, visitUtf8Constant
visitAnnotationDefaultAttribute, visitAnyAnnotationsAttribute, visitAnyParameterAnnotationsAttribute, visitAnyTypeAnnotationsAttribute, visitBootstrapMethodsAttribute, visitConstantValueAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitEnclosingMethodAttribute, visitExceptionsAttribute, visitInnerClassesAttribute, visitLineNumberTableAttribute, visitLocalVariableTableAttribute, visitLocalVariableTypeTableAttribute, visitMethodParametersAttribute, visitModuleAttribute, visitModuleMainClassAttribute, visitModulePackagesAttribute, visitNestHostAttribute, visitNestMembersAttribute, visitPermittedSubclassesAttribute, visitRecordAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleParameterAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleParameterAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSourceDebugExtensionAttribute, visitSourceDirAttribute, visitSourceFileAttribute, visitStackMapAttribute, visitStackMapTableAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitUnknownAttribute
public static final int X
public static final int Y
public static final int Z
public static final int A
public static final int B
public static final int C
public static final int D
public DynamicClassReferenceInitializer(ClassPool programClassPool, ClassPool libraryClassPool, WarningPrinter missingNotePrinter, WarningPrinter dependencyWarningPrinter, WarningPrinter notePrinter, StringMatcher noteExceptionMatcher)
public DynamicClassReferenceInitializer(ClassPool programClassPool, ClassPool libraryClassPool, WarningPrinter missingNotePrinter, WarningPrinter dependencyWarningPrinter, WarningPrinter notePrinter, StringMatcher noteExceptionMatcher, ClassVisitor extraClassVisitor)
public void visitAnyClass(Clazz clazz)
ClassVisitor
visitAnyClass
in interface ClassVisitor
public void visitProgramClass(ProgramClass programClass)
visitProgramClass
in interface ClassVisitor
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction)
InstructionVisitor
visitAnyInstruction
in interface InstructionVisitor
public void visitStringConstant(Clazz clazz, StringConstant stringConstant)
visitStringConstant
in interface ConstantVisitor
public void visitClassConstant(Clazz clazz, ClassConstant classConstant)
visitClassConstant
in interface ConstantVisitor
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant)
visitMethodrefConstant
in interface ConstantVisitor
public void visitAnyAttribute(Clazz clazz, Attribute attribute)
AttributeVisitor
visitAnyAttribute
in interface AttributeVisitor
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
visitCodeAttribute
in interface AttributeVisitor