public class DynamicMemberReferenceInitializer extends java.lang.Object implements ClassVisitor, AttributeVisitor, InstructionVisitor, ConstantVisitor, MemberVisitor
AttributeVisitor
initializes any constant class member references of all code that
it visits. It currently handles invocations of Class#get[Declared]{Field,Constructor,Method} and
Atomic{Integer,Long,Reference}FieldUpdater.newUpdater with constant string arguments. It lets the
corresponding string constants refer to their class members in the program class pool or in the
library class pool. It may create new string constants and update the code, in order to avoid
clashes between identically named class members.
The class hierarchy and references must be initialized before using this visitor.
It's more efficient to use as a ClassVisitor
than an InstructionVisitor
.
Constructor and Description |
---|
DynamicMemberReferenceInitializer(ClassPool programClassPool,
ClassPool libraryClassPool,
WarningPrinter notePrinter,
StringMatcher noteFieldExceptionMatcher,
StringMatcher noteMethodExceptionMatcher)
Creates a new DynamicMemberReferenceInitializer.
|
DynamicMemberReferenceInitializer(ClassPool programClassPool,
ClassPool libraryClassPool,
WarningPrinter notePrinter,
StringMatcher noteFieldExceptionMatcher,
StringMatcher noteMethodExceptionMatcher,
MemberVisitor extraMemberVisitor)
Creates a new DynamicMemberReferenceInitializer.
|
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) |
void |
visitCodeAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute) |
void |
visitLibraryField(LibraryClass libraryClass,
LibraryField libraryField) |
void |
visitLibraryMethod(LibraryClass libraryClass,
LibraryMethod libraryMethod) |
void |
visitProgramClass(ProgramClass programClass) |
void |
visitProgramField(ProgramClass programClass,
ProgramField programField) |
void |
visitProgramMethod(ProgramClass programClass,
ProgramMethod programMethod) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
visitLibraryClass
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
visitAnySwitchInstruction, visitBranchInstruction, visitConstantInstruction, visitLookUpSwitchInstruction, visitSimpleInstruction, visitTableSwitchInstruction, visitVariableInstruction
visitAnyConstant, visitAnyMethodrefConstant, visitAnyRefConstant, visitDoubleConstant, visitDynamicConstant, visitFieldrefConstant, visitFloatConstant, visitIntegerConstant, visitInterfaceMethodrefConstant, visitInvokeDynamicConstant, visitLongConstant, visitMethodHandleConstant, visitMethodrefConstant, visitMethodTypeConstant, visitModuleConstant, visitNameAndTypeConstant, visitPackageConstant, visitPrimitiveArrayConstant, visitStringConstant, visitUtf8Constant
visitAnyMember, visitLibraryMember, visitProgramMember
public DynamicMemberReferenceInitializer(ClassPool programClassPool, ClassPool libraryClassPool, WarningPrinter notePrinter, StringMatcher noteFieldExceptionMatcher, StringMatcher noteMethodExceptionMatcher)
public DynamicMemberReferenceInitializer(ClassPool programClassPool, ClassPool libraryClassPool, WarningPrinter notePrinter, StringMatcher noteFieldExceptionMatcher, StringMatcher noteMethodExceptionMatcher, MemberVisitor extraMemberVisitor)
public void visitAnyClass(Clazz clazz)
ClassVisitor
visitAnyClass
in interface ClassVisitor
public void visitProgramClass(ProgramClass programClass)
visitProgramClass
in interface ClassVisitor
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
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction)
InstructionVisitor
visitAnyInstruction
in interface InstructionVisitor
public void visitClassConstant(Clazz clazz, ClassConstant classConstant)
visitClassConstant
in interface ConstantVisitor
public void visitProgramField(ProgramClass programClass, ProgramField programField)
visitProgramField
in interface MemberVisitor
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
visitProgramMethod
in interface MemberVisitor
public void visitLibraryField(LibraryClass libraryClass, LibraryField libraryField)
visitLibraryField
in interface MemberVisitor
public void visitLibraryMethod(LibraryClass libraryClass, LibraryMethod libraryMethod)
visitLibraryMethod
in interface MemberVisitor