类 CodeAttributeComposer
- java.lang.Object
-
- proguard.classfile.editor.CodeAttributeComposer
-
- 所有已实现的接口:
LocalVariableTargetElementVisitor,TargetInfoVisitor,TypeAnnotationVisitor,StackMapFrameVisitor,VerificationTypeVisitor,AttributeVisitor,ExceptionInfoVisitor,LineNumberInfoVisitor,LocalVariableInfoVisitor,LocalVariableTypeInfoVisitor,InstructionVisitor
public class CodeAttributeComposer extends java.lang.Object implements AttributeVisitor, InstructionVisitor, ExceptionInfoVisitor, StackMapFrameVisitor, VerificationTypeVisitor, LineNumberInfoVisitor, LocalVariableInfoVisitor, LocalVariableTypeInfoVisitor, TypeAnnotationVisitor, TargetInfoVisitor, LocalVariableTargetElementVisitor
ThisAttributeVisitoraccumulates instructions, exceptions and line numbers, and then adds them to a method or copies them into code attributes that it visits.The class supports composing instructions (
appendInstruction(Instruction)), labels (appendLabel(int)), exception handlers (appendException(ExceptionInfo)), and line numbers (appendLineNumber(LineNumberInfo)).The labels are numeric labels that you can choose freely, for example instruction offsets from existing code that you are copying. You can then refer to them in branches and exception handlers. You can compose the code as a hierarchy of code fragments with their own local labels.
You should provide an estimated maximum size (expressed in number of bytes in the bytecode), so the implementation can efficiently allocate the necessary internal buffers without reallocating them as the code grows.
For example:
ProgramClass programClass = ... ProgramMethod programMethod = ... // Create any constants for the code. ConstantPoolEditor constantPoolEditor = new ConstantPoolEditor(programClass); int exceptionType = constantPoolEditor.addClassConstant("java/lang/Exception", null); // Compose the code. CodeAttributeComposer composer = new CodeAttributeComposer(); final int TRY_LABEL = 0; final int IF_LABEL = 1; final int THEN_LABEL = 10; final int ELSE_LABEL = 20; final int CATCH_LABEL = 30; composer.beginCodeFragment(50); composer.appendLabel(TRY_LABEL); composer.appendInstruction(new SimpleInstruction(Instruction.OP_ICONST_1)); composer.appendInstruction(new SimpleInstruction(Instruction.OP_ICONST_2)); composer.appendLabel(IF_LABEL); composer.appendInstruction(new BranchInstruction(Instruction.OP_IFICMPLT, ELSE_LABEL - IF_LABEL)); composer.appendLabel(THEN_LABEL); composer.appendInstruction(new SimpleInstruction(Instruction.OP_ICONST_1)); composer.appendInstruction(new SimpleInstruction(Instruction.OP_IRETURN)); composer.appendLabel(ELSE_LABEL); composer.appendInstruction(new SimpleInstruction(Instruction.OP_ICONST_2)); composer.appendInstruction(new SimpleInstruction(Instruction.OP_IRETURN)); composer.appendLabel(CATCH_LABEL); composer.appendException(new ExceptionInfo(TRY_LABEL, CATCH_LABEL, CATCH_LABEL, exceptionType)); composer.appendInstruction(new SimpleInstruction(Instruction.OP_ICONST_M1)); composer.appendInstruction(new SimpleInstruction(Instruction.OP_IRETURN)); composer.endCodeFragment(); // Add the code as a code attribute to the given method. composer.addCodeAttribute(programClass, programMethod, constantPoolEditor);This class is mostly convenient to compose code based on existing code, where the instructions are already available. For a more compact and readable alternative to compose code programmatically from scratch, see
CompactCodeAttributeComposer.If you're building many method bodies, it is more efficient to reuse a single instance of this composer for all methods that you add.
-
-
构造器概要
构造器 构造器 说明 CodeAttributeComposer()Creates a new CodeAttributeComposer that doesn't allow external branch targets or exception offsets and that automatically shrinks instructions.CodeAttributeComposer(boolean allowExternalBranchTargets, boolean allowExternalExceptionOffsets, boolean shrinkInstructions)Creates a new CodeAttributeComposer.CodeAttributeComposer(boolean allowExternalBranchTargets, boolean allowExternalExceptionOffsets, boolean shrinkInstructions, boolean absoluteBranchOffsets)Creates a new CodeAttributeComposer.
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddCodeAttribute(ProgramClass programClass, ProgramMethod programMethod)Adds the code that has been built as a code attribute to the given method.voidaddCodeAttribute(ProgramClass programClass, ProgramMethod programMethod, ConstantPoolEditor constantPoolEditor)Adds the code that has been built as a code attribute to the given method.voidaddException(ExceptionInfo exceptionInfo, int index)voidappendException(ExceptionInfo exceptionInfo)Appends the given exception to the exception table.voidappendInstruction(int oldInstructionOffset, Instruction instruction)Appends the given instruction with the given old offset.voidappendInstruction(Instruction instruction)Appends the given instruction without a defined offset.voidappendInstructions(Instruction[] instructions)Appends the given instruction without defined offsets.voidappendLabel(int oldInstructionOffset)Appends the given label with the given old offset.voidappendLineNumber(LineNumberInfo lineNumberInfo)Appends the given line number to the line number table.voidbeginCodeFragment(int maximumCodeFragmentLength)Starts a new code fragment.voidendCodeFragment()Wraps up the current code fragment, continuing with the previous one on the stack.intgetCodeLength()Returns the current length (in bytes) of the code attribute being composed.intinsertLineNumber(int minimumIndex, LineNumberInfo lineNumberInfo)Inserts the given line number at the appropriate position in the line number table.intinsertLineNumber(LineNumberInfo lineNumberInfo)Inserts the given line number at the appropriate position in the line number table.static voidmain(java.lang.String[] args)Small sample application that illustrates the use of this class.voidreset()Starts a new code definition.voidvisitAnyAttribute(Clazz clazz, Attribute attribute)Visits any Attribute instance.voidvisitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction)Visits any Instruction instance.voidvisitAnyStackMapFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, StackMapFrame stackMapFrame)Visits any StackMapFrame instance.voidvisitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction)Visits any SwitchInstruction instance.voidvisitAnyTargetInfo(Clazz clazz, TypeAnnotation typeAnnotation, TargetInfo targetInfo)Visits any TargetInfo instance.voidvisitAnyTypeAnnotationsAttribute(Clazz clazz, TypeAnnotationsAttribute typeAnnotationsAttribute)Visits any TypeAnnotationsAttribute instance.voidvisitAnyVerificationType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VerificationType verificationType)Visits any VerificationType instance.voidvisitBranchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, BranchInstruction branchInstruction)voidvisitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)Sets the code that has been built in the given code attribute.voidvisitExceptionInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, ExceptionInfo exceptionInfo)voidvisitFullFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, FullFrame fullFrame)voidvisitLineNumberInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberInfo lineNumberInfo)voidvisitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)voidvisitLocalVariableInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableInfo localVariableInfo)voidvisitLocalVariableTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTableAttribute localVariableTableAttribute)voidvisitLocalVariableTargetElement(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, LocalVariableTargetInfo localVariableTargetInfo, LocalVariableTargetElement localVariableTargetElement)voidvisitLocalVariableTargetInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, LocalVariableTargetInfo localVariableTargetInfo)voidvisitLocalVariableTypeInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeInfo localVariableTypeInfo)voidvisitLocalVariableTypeTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeTableAttribute localVariableTypeTableAttribute)voidvisitMoreZeroFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, MoreZeroFrame moreZeroFrame)voidvisitOffsetTargetInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, OffsetTargetInfo offsetTargetInfo)voidvisitRuntimeInvisibleTypeAnnotationsAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, RuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute)voidvisitRuntimeVisibleTypeAnnotationsAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, RuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute)voidvisitSameOneFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SameOneFrame sameOneFrame)voidvisitStackMapAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapAttribute stackMapAttribute)voidvisitStackMapTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapTableAttribute stackMapTableAttribute)voidvisitTypeAnnotation(Clazz clazz, TypeAnnotation typeAnnotation)Visits any TypeAnnotation instance.voidvisitTypeAnnotation(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation)voidvisitTypeArgumentTargetInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, TypeArgumentTargetInfo typeArgumentTargetInfo)voidvisitUninitializedType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, UninitializedType uninitializedType)-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 proguard.classfile.attribute.visitor.AttributeVisitor
visitAnnotationDefaultAttribute, visitAnyAnnotationsAttribute, visitAnyParameterAnnotationsAttribute, visitBootstrapMethodsAttribute, visitConstantValueAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitEnclosingMethodAttribute, visitExceptionsAttribute, visitInnerClassesAttribute, visitMethodParametersAttribute, visitModuleAttribute, visitModuleMainClassAttribute, visitModulePackagesAttribute, visitNestHostAttribute, visitNestMembersAttribute, visitPermittedSubclassesAttribute, visitRecordAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleParameterAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleParameterAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSourceDebugExtensionAttribute, visitSourceDirAttribute, visitSourceFileAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitUnknownAttribute
-
从接口继承的方法 proguard.classfile.instruction.visitor.InstructionVisitor
visitConstantInstruction, visitLookUpSwitchInstruction, visitSimpleInstruction, visitTableSwitchInstruction, visitVariableInstruction
-
从接口继承的方法 proguard.classfile.attribute.preverification.visitor.StackMapFrameVisitor
visitLessZeroFrame, visitSameZeroFrame
-
从接口继承的方法 proguard.classfile.attribute.annotation.target.visitor.TargetInfoVisitor
visitCatchTargetInfo, visitEmptyTargetInfo, visitEmptyTargetInfo, visitEmptyTargetInfo, visitFormalParameterTargetInfo, visitSuperTypeTargetInfo, visitThrowsTargetInfo, visitTypeParameterBoundTargetInfo, visitTypeParameterBoundTargetInfo, visitTypeParameterBoundTargetInfo, visitTypeParameterBoundTargetInfo, visitTypeParameterTargetInfo, visitTypeParameterTargetInfo
-
从接口继承的方法 proguard.classfile.attribute.annotation.visitor.TypeAnnotationVisitor
visitTypeAnnotation, visitTypeAnnotation, visitTypeAnnotation, visitTypeAnnotation
-
从接口继承的方法 proguard.classfile.attribute.preverification.visitor.VerificationTypeVisitor
visitDoubleType, visitFloatType, visitIntegerType, visitLongType, visitNullType, visitObjectType, visitStackDoubleType, visitStackFloatType, visitStackIntegerType, visitStackLongType, visitStackNullType, visitStackObjectType, visitStackTopType, visitStackUninitializedThisType, visitStackUninitializedType, visitTopType, visitUninitializedThisType, visitVariablesDoubleType, visitVariablesFloatType, visitVariablesIntegerType, visitVariablesLongType, visitVariablesNullType, visitVariablesObjectType, visitVariablesTopType, visitVariablesUninitializedThisType, visitVariablesUninitializedType
-
-
-
-
构造器详细资料
-
CodeAttributeComposer
public CodeAttributeComposer()
Creates a new CodeAttributeComposer that doesn't allow external branch targets or exception offsets and that automatically shrinks instructions.
-
CodeAttributeComposer
public CodeAttributeComposer(boolean allowExternalBranchTargets, boolean allowExternalExceptionOffsets, boolean shrinkInstructions)Creates a new CodeAttributeComposer.- 参数:
allowExternalBranchTargets- specifies whether branch targets can lie outside the code fragment of the branch instructions.allowExternalExceptionOffsets- specifies whether exception offsets can lie outside the code fragment in which exceptions are defined.shrinkInstructions- specifies whether instructions should automatically be shrunk before being written.
-
CodeAttributeComposer
public CodeAttributeComposer(boolean allowExternalBranchTargets, boolean allowExternalExceptionOffsets, boolean shrinkInstructions, boolean absoluteBranchOffsets)Creates a new CodeAttributeComposer.- 参数:
allowExternalBranchTargets- specifies whether branch targets can lie outside the code fragment of the branch instructions.allowExternalExceptionOffsets- specifies whether exception offsets can lie outside the code fragment in which exceptions are defined.shrinkInstructions- specifies whether instructions should automatically be shrunk before being written.absoluteBranchOffsets- specifies whether offsets of appended branch instructions and switch instructions are absolute, that is, relative to the start of the code, instead of relative to the instructions. This may simplify creating code manually, assuming the offsets don't overflow.
-
-
方法详细资料
-
reset
public void reset()
Starts a new code definition.
-
beginCodeFragment
public void beginCodeFragment(int maximumCodeFragmentLength)
Starts a new code fragment. Branch instructions that are added are assumed to be relative within such code fragments.- 参数:
maximumCodeFragmentLength- the maximum length of the code that will be added as part of this fragment (more precisely, the maximum old instruction offset or label that is specified, plus one).
-
getCodeLength
public int getCodeLength()
Returns the current length (in bytes) of the code attribute being composed.
-
appendInstruction
public void appendInstruction(int oldInstructionOffset, Instruction instruction)Appends the given instruction with the given old offset. Branch instructions must fit, for instance by enabling automatic shrinking of instructions.- 参数:
oldInstructionOffset- the old offset of the instruction, to which branches and other references in the current code fragment are pointing.instruction- the instruction to be appended.
-
appendLabel
public void appendLabel(int oldInstructionOffset)
Appends the given label with the given old offset.- 参数:
oldInstructionOffset- the old offset of the label, to which branches and other references in the current code fragment are pointing.
-
appendInstructions
public void appendInstructions(Instruction[] instructions)
Appends the given instruction without defined offsets.- 参数:
instructions- the instructions to be appended.
-
appendInstruction
public void appendInstruction(Instruction instruction)
Appends the given instruction without a defined offset. Branch instructions should have a label, to allow computing the new relative offset. Branch instructions must fit, for instance by enabling automatic shrinking of instructions.- 参数:
instruction- the instruction to be appended.
-
appendException
public void appendException(ExceptionInfo exceptionInfo)
Appends the given exception to the exception table.- 参数:
exceptionInfo- the exception to be appended.
-
addException
public void addException(ExceptionInfo exceptionInfo, int index)
-
insertLineNumber
public int insertLineNumber(LineNumberInfo lineNumberInfo)
Inserts the given line number at the appropriate position in the line number table.- 参数:
lineNumberInfo- the line number to be inserted.- 返回:
- the index where the line number was actually inserted.
-
insertLineNumber
public int insertLineNumber(int minimumIndex, LineNumberInfo lineNumberInfo)Inserts the given line number at the appropriate position in the line number table.- 参数:
minimumIndex- the minimum index where the line number may be inserted.lineNumberInfo- the line number to be inserted.- 返回:
- the index where the line number was inserted.
-
appendLineNumber
public void appendLineNumber(LineNumberInfo lineNumberInfo)
Appends the given line number to the line number table.- 参数:
lineNumberInfo- the line number to be appended.
-
endCodeFragment
public void endCodeFragment()
Wraps up the current code fragment, continuing with the previous one on the stack.
-
addCodeAttribute
public void addCodeAttribute(ProgramClass programClass, ProgramMethod programMethod)
Adds the code that has been built as a code attribute to the given method.
-
addCodeAttribute
public void addCodeAttribute(ProgramClass programClass, ProgramMethod programMethod, ConstantPoolEditor constantPoolEditor)
Adds the code that has been built as a code attribute to the given method. Reuses the given constant pool editor, which may be more efficient.
-
visitAnyAttribute
public void visitAnyAttribute(Clazz clazz, Attribute attribute)
从接口复制的说明:AttributeVisitorVisits any Attribute instance. The more specific default implementations of this interface delegate to this method.- 指定者:
visitAnyAttribute在接口中AttributeVisitor
-
visitCodeAttribute
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
Sets the code that has been built in the given code attribute.- 指定者:
visitCodeAttribute在接口中AttributeVisitor
-
visitStackMapAttribute
public void visitStackMapAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapAttribute stackMapAttribute)
- 指定者:
visitStackMapAttribute在接口中AttributeVisitor
-
visitStackMapTableAttribute
public void visitStackMapTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapTableAttribute stackMapTableAttribute)
- 指定者:
visitStackMapTableAttribute在接口中AttributeVisitor
-
visitLineNumberTableAttribute
public void visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)
-
visitLocalVariableTableAttribute
public void visitLocalVariableTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTableAttribute localVariableTableAttribute)
-
visitLocalVariableTypeTableAttribute
public void visitLocalVariableTypeTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeTableAttribute localVariableTypeTableAttribute)
-
visitAnyTypeAnnotationsAttribute
public void visitAnyTypeAnnotationsAttribute(Clazz clazz, TypeAnnotationsAttribute typeAnnotationsAttribute)
从接口复制的说明:AttributeVisitorVisits any TypeAnnotationsAttribute instance. The more specific default implementations of this interface delegate to this method.
-
visitRuntimeVisibleTypeAnnotationsAttribute
public void visitRuntimeVisibleTypeAnnotationsAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, RuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute)
-
visitRuntimeInvisibleTypeAnnotationsAttribute
public void visitRuntimeInvisibleTypeAnnotationsAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, RuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute)
-
visitAnyInstruction
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction)
从接口复制的说明:InstructionVisitorVisits any Instruction instance. The more specific default implementations of this interface delegate to this method.- 指定者:
visitAnyInstruction在接口中InstructionVisitor
-
visitBranchInstruction
public void visitBranchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, BranchInstruction branchInstruction)
- 指定者:
visitBranchInstruction在接口中InstructionVisitor
-
visitAnySwitchInstruction
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction)
从接口复制的说明:InstructionVisitorVisits any SwitchInstruction instance. The more specific default implementations of this interface delegate to this method.- 指定者:
visitAnySwitchInstruction在接口中InstructionVisitor
-
visitExceptionInfo
public void visitExceptionInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, ExceptionInfo exceptionInfo)
- 指定者:
visitExceptionInfo在接口中ExceptionInfoVisitor
-
visitAnyStackMapFrame
public void visitAnyStackMapFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, StackMapFrame stackMapFrame)
从接口复制的说明:StackMapFrameVisitorVisits any StackMapFrame instance. The more specific default implementations of this interface delegate to this method.- 指定者:
visitAnyStackMapFrame在接口中StackMapFrameVisitor
-
visitSameOneFrame
public void visitSameOneFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SameOneFrame sameOneFrame)
- 指定者:
visitSameOneFrame在接口中StackMapFrameVisitor
-
visitMoreZeroFrame
public void visitMoreZeroFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, MoreZeroFrame moreZeroFrame)
- 指定者:
visitMoreZeroFrame在接口中StackMapFrameVisitor
-
visitFullFrame
public void visitFullFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, FullFrame fullFrame)
- 指定者:
visitFullFrame在接口中StackMapFrameVisitor
-
visitAnyVerificationType
public void visitAnyVerificationType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VerificationType verificationType)
从接口复制的说明:VerificationTypeVisitorVisits any VerificationType instance. The more specific default implementations of this interface delegate to this method.
-
visitUninitializedType
public void visitUninitializedType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, UninitializedType uninitializedType)
-
visitLineNumberInfo
public void visitLineNumberInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberInfo lineNumberInfo)
- 指定者:
visitLineNumberInfo在接口中LineNumberInfoVisitor
-
visitLocalVariableInfo
public void visitLocalVariableInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableInfo localVariableInfo)
-
visitLocalVariableTypeInfo
public void visitLocalVariableTypeInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeInfo localVariableTypeInfo)
-
visitTypeAnnotation
public void visitTypeAnnotation(Clazz clazz, TypeAnnotation typeAnnotation)
从接口复制的说明:TypeAnnotationVisitorVisits any TypeAnnotation instance. The more specific default implementations of this interface delegate to this method.- 指定者:
visitTypeAnnotation在接口中TypeAnnotationVisitor
-
visitTypeAnnotation
public void visitTypeAnnotation(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation)
- 指定者:
visitTypeAnnotation在接口中TypeAnnotationVisitor
-
visitAnyTargetInfo
public void visitAnyTargetInfo(Clazz clazz, TypeAnnotation typeAnnotation, TargetInfo targetInfo)
从接口复制的说明:TargetInfoVisitorVisits any TargetInfo instance. The more specific default implementations of this interface delegate to this method.- 指定者:
visitAnyTargetInfo在接口中TargetInfoVisitor
-
visitLocalVariableTargetInfo
public void visitLocalVariableTargetInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, LocalVariableTargetInfo localVariableTargetInfo)
-
visitOffsetTargetInfo
public void visitOffsetTargetInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, OffsetTargetInfo offsetTargetInfo)
- 指定者:
visitOffsetTargetInfo在接口中TargetInfoVisitor
-
visitTypeArgumentTargetInfo
public void visitTypeArgumentTargetInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, TypeArgumentTargetInfo typeArgumentTargetInfo)
- 指定者:
visitTypeArgumentTargetInfo在接口中TargetInfoVisitor
-
visitLocalVariableTargetElement
public void visitLocalVariableTargetElement(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, LocalVariableTargetInfo localVariableTargetInfo, LocalVariableTargetElement localVariableTargetElement)
-
main
public static void main(java.lang.String[] args)
Small sample application that illustrates the use of this class.
-
-