Class CodeAttributeComposer
- java.lang.Object
-
- proguard.classfile.editor.CodeAttributeComposer
-
- All Implemented Interfaces:
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
ThisAttributeVisitor
accumulates 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.
-
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCodeAttribute(ProgramClass programClass, ProgramMethod programMethod)
Adds the code that has been built as a code attribute to the given method.void
addCodeAttribute(ProgramClass programClass, ProgramMethod programMethod, ConstantPoolEditor constantPoolEditor)
Adds the code that has been built as a code attribute to the given method.void
appendException(ExceptionInfo exceptionInfo)
Appends the given exception to the exception table.void
appendInstruction(int oldInstructionOffset, Instruction instruction)
Appends the given instruction with the given old offset.void
appendInstruction(Instruction instruction)
Appends the given instruction without a defined offset.void
appendInstructions(Instruction[] instructions)
Appends the given instruction without defined offsets.void
appendLabel(int oldInstructionOffset)
Appends the given label with the given old offset.void
appendLineNumber(LineNumberInfo lineNumberInfo)
Appends the given line number to the line number table.void
beginCodeFragment(int maximumCodeFragmentLength)
Starts a new code fragment.void
endCodeFragment()
Wraps up the current code fragment, continuing with the previous one on the stack.int
getCodeLength()
Returns the current length (in bytes) of the code attribute being composed.int
insertLineNumber(int minimumIndex, LineNumberInfo lineNumberInfo)
Inserts the given line number at the appropriate position in the line number table.int
insertLineNumber(LineNumberInfo lineNumberInfo)
Inserts the given line number at the appropriate position in the line number table.static void
main(java.lang.String[] args)
Small sample application that illustrates the use of this class.void
reset()
Starts a new code definition.void
visitAnyAttribute(Clazz clazz, Attribute attribute)
Visits any Attribute instance.void
visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction)
Visits any Instruction instance.void
visitAnyStackMapFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, StackMapFrame stackMapFrame)
Visits any StackMapFrame instance.void
visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction)
Visits any SwitchInstruction instance.void
visitAnyTargetInfo(Clazz clazz, TypeAnnotation typeAnnotation, TargetInfo targetInfo)
Visits any TargetInfo instance.void
visitAnyTypeAnnotationsAttribute(Clazz clazz, TypeAnnotationsAttribute typeAnnotationsAttribute)
Visits any TypeAnnotationsAttribute instance.void
visitAnyVerificationType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VerificationType verificationType)
Visits any VerificationType instance.void
visitBranchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, BranchInstruction branchInstruction)
void
visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
Sets the code that has been built in the given code attribute.void
visitExceptionInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, ExceptionInfo exceptionInfo)
void
visitFullFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, FullFrame fullFrame)
void
visitLineNumberInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberInfo lineNumberInfo)
void
visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)
void
visitLocalVariableInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableInfo localVariableInfo)
void
visitLocalVariableTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTableAttribute localVariableTableAttribute)
void
visitLocalVariableTargetElement(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, LocalVariableTargetInfo localVariableTargetInfo, LocalVariableTargetElement localVariableTargetElement)
void
visitLocalVariableTargetInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, LocalVariableTargetInfo localVariableTargetInfo)
void
visitLocalVariableTypeInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeInfo localVariableTypeInfo)
void
visitLocalVariableTypeTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeTableAttribute localVariableTypeTableAttribute)
void
visitMoreZeroFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, MoreZeroFrame moreZeroFrame)
void
visitOffsetTargetInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, OffsetTargetInfo offsetTargetInfo)
void
visitRuntimeInvisibleTypeAnnotationsAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, RuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute)
void
visitRuntimeVisibleTypeAnnotationsAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, RuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute)
void
visitSameOneFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SameOneFrame sameOneFrame)
void
visitStackMapAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapAttribute stackMapAttribute)
void
visitStackMapTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapTableAttribute stackMapTableAttribute)
void
visitTypeAnnotation(Clazz clazz, TypeAnnotation typeAnnotation)
Visits any TypeAnnotation instance.void
visitTypeAnnotation(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation)
void
visitTypeArgumentTargetInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, TypeArgumentTargetInfo typeArgumentTargetInfo)
void
visitUninitializedType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, UninitializedType uninitializedType)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface 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
-
Methods inherited from interface proguard.classfile.instruction.visitor.InstructionVisitor
visitConstantInstruction, visitLookUpSwitchInstruction, visitSimpleInstruction, visitTableSwitchInstruction, visitVariableInstruction
-
Methods inherited from interface proguard.classfile.attribute.preverification.visitor.StackMapFrameVisitor
visitLessZeroFrame, visitSameZeroFrame
-
Methods inherited from interface proguard.classfile.attribute.annotation.target.visitor.TargetInfoVisitor
visitCatchTargetInfo, visitEmptyTargetInfo, visitEmptyTargetInfo, visitEmptyTargetInfo, visitFormalParameterTargetInfo, visitSuperTypeTargetInfo, visitThrowsTargetInfo, visitTypeParameterBoundTargetInfo, visitTypeParameterBoundTargetInfo, visitTypeParameterBoundTargetInfo, visitTypeParameterBoundTargetInfo, visitTypeParameterTargetInfo, visitTypeParameterTargetInfo
-
Methods inherited from interface proguard.classfile.attribute.annotation.visitor.TypeAnnotationVisitor
visitTypeAnnotation, visitTypeAnnotation, visitTypeAnnotation, visitTypeAnnotation
-
Methods inherited from interface 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
-
-
-
-
Constructor Detail
-
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.- Parameters:
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.- Parameters:
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.
-
-
Method Detail
-
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.- Parameters:
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.- Parameters:
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.- Parameters:
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.- Parameters:
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.- Parameters:
instruction
- the instruction to be appended.
-
appendException
public void appendException(ExceptionInfo exceptionInfo)
Appends the given exception to the exception table.- Parameters:
exceptionInfo
- the exception to be appended.
-
insertLineNumber
public int insertLineNumber(LineNumberInfo lineNumberInfo)
Inserts the given line number at the appropriate position in the line number table.- Parameters:
lineNumberInfo
- the line number to be inserted.- Returns:
- 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.- Parameters:
minimumIndex
- the minimum index where the line number may be inserted.lineNumberInfo
- the line number to be inserted.- Returns:
- the index where the line number was inserted.
-
appendLineNumber
public void appendLineNumber(LineNumberInfo lineNumberInfo)
Appends the given line number to the line number table.- Parameters:
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)
Description copied from interface:AttributeVisitor
Visits any Attribute instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyAttribute
in interfaceAttributeVisitor
-
visitCodeAttribute
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
Sets the code that has been built in the given code attribute.- Specified by:
visitCodeAttribute
in interfaceAttributeVisitor
-
visitStackMapAttribute
public void visitStackMapAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapAttribute stackMapAttribute)
- Specified by:
visitStackMapAttribute
in interfaceAttributeVisitor
-
visitStackMapTableAttribute
public void visitStackMapTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapTableAttribute stackMapTableAttribute)
- Specified by:
visitStackMapTableAttribute
in interfaceAttributeVisitor
-
visitLineNumberTableAttribute
public void visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)
- Specified by:
visitLineNumberTableAttribute
in interfaceAttributeVisitor
-
visitLocalVariableTableAttribute
public void visitLocalVariableTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTableAttribute localVariableTableAttribute)
- Specified by:
visitLocalVariableTableAttribute
in interfaceAttributeVisitor
-
visitLocalVariableTypeTableAttribute
public void visitLocalVariableTypeTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeTableAttribute localVariableTypeTableAttribute)
- Specified by:
visitLocalVariableTypeTableAttribute
in interfaceAttributeVisitor
-
visitAnyTypeAnnotationsAttribute
public void visitAnyTypeAnnotationsAttribute(Clazz clazz, TypeAnnotationsAttribute typeAnnotationsAttribute)
Description copied from interface:AttributeVisitor
Visits any TypeAnnotationsAttribute instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyTypeAnnotationsAttribute
in interfaceAttributeVisitor
-
visitRuntimeVisibleTypeAnnotationsAttribute
public void visitRuntimeVisibleTypeAnnotationsAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, RuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute)
- Specified by:
visitRuntimeVisibleTypeAnnotationsAttribute
in interfaceAttributeVisitor
-
visitRuntimeInvisibleTypeAnnotationsAttribute
public void visitRuntimeInvisibleTypeAnnotationsAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, RuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute)
- Specified by:
visitRuntimeInvisibleTypeAnnotationsAttribute
in interfaceAttributeVisitor
-
visitAnyInstruction
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction)
Description copied from interface:InstructionVisitor
Visits any Instruction instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyInstruction
in interfaceInstructionVisitor
-
visitBranchInstruction
public void visitBranchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, BranchInstruction branchInstruction)
- Specified by:
visitBranchInstruction
in interfaceInstructionVisitor
-
visitAnySwitchInstruction
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction)
Description copied from interface:InstructionVisitor
Visits any SwitchInstruction instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnySwitchInstruction
in interfaceInstructionVisitor
-
visitExceptionInfo
public void visitExceptionInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, ExceptionInfo exceptionInfo)
- Specified by:
visitExceptionInfo
in interfaceExceptionInfoVisitor
-
visitAnyStackMapFrame
public void visitAnyStackMapFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, StackMapFrame stackMapFrame)
Description copied from interface:StackMapFrameVisitor
Visits any StackMapFrame instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyStackMapFrame
in interfaceStackMapFrameVisitor
-
visitSameOneFrame
public void visitSameOneFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SameOneFrame sameOneFrame)
- Specified by:
visitSameOneFrame
in interfaceStackMapFrameVisitor
-
visitMoreZeroFrame
public void visitMoreZeroFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, MoreZeroFrame moreZeroFrame)
- Specified by:
visitMoreZeroFrame
in interfaceStackMapFrameVisitor
-
visitFullFrame
public void visitFullFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, FullFrame fullFrame)
- Specified by:
visitFullFrame
in interfaceStackMapFrameVisitor
-
visitAnyVerificationType
public void visitAnyVerificationType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VerificationType verificationType)
Description copied from interface:VerificationTypeVisitor
Visits any VerificationType instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyVerificationType
in interfaceVerificationTypeVisitor
-
visitUninitializedType
public void visitUninitializedType(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, UninitializedType uninitializedType)
- Specified by:
visitUninitializedType
in interfaceVerificationTypeVisitor
-
visitLineNumberInfo
public void visitLineNumberInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberInfo lineNumberInfo)
- Specified by:
visitLineNumberInfo
in interfaceLineNumberInfoVisitor
-
visitLocalVariableInfo
public void visitLocalVariableInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableInfo localVariableInfo)
- Specified by:
visitLocalVariableInfo
in interfaceLocalVariableInfoVisitor
-
visitLocalVariableTypeInfo
public void visitLocalVariableTypeInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeInfo localVariableTypeInfo)
- Specified by:
visitLocalVariableTypeInfo
in interfaceLocalVariableTypeInfoVisitor
-
visitTypeAnnotation
public void visitTypeAnnotation(Clazz clazz, TypeAnnotation typeAnnotation)
Description copied from interface:TypeAnnotationVisitor
Visits any TypeAnnotation instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitTypeAnnotation
in interfaceTypeAnnotationVisitor
-
visitTypeAnnotation
public void visitTypeAnnotation(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation)
- Specified by:
visitTypeAnnotation
in interfaceTypeAnnotationVisitor
-
visitAnyTargetInfo
public void visitAnyTargetInfo(Clazz clazz, TypeAnnotation typeAnnotation, TargetInfo targetInfo)
Description copied from interface:TargetInfoVisitor
Visits any TargetInfo instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyTargetInfo
in interfaceTargetInfoVisitor
-
visitLocalVariableTargetInfo
public void visitLocalVariableTargetInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, LocalVariableTargetInfo localVariableTargetInfo)
- Specified by:
visitLocalVariableTargetInfo
in interfaceTargetInfoVisitor
-
visitOffsetTargetInfo
public void visitOffsetTargetInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, OffsetTargetInfo offsetTargetInfo)
- Specified by:
visitOffsetTargetInfo
in interfaceTargetInfoVisitor
-
visitTypeArgumentTargetInfo
public void visitTypeArgumentTargetInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, TypeArgumentTargetInfo typeArgumentTargetInfo)
- Specified by:
visitTypeArgumentTargetInfo
in interfaceTargetInfoVisitor
-
visitLocalVariableTargetElement
public void visitLocalVariableTargetElement(Clazz clazz, Method method, CodeAttribute codeAttribute, TypeAnnotation typeAnnotation, LocalVariableTargetInfo localVariableTargetInfo, LocalVariableTargetElement localVariableTargetElement)
- Specified by:
visitLocalVariableTargetElement
in interfaceLocalVariableTargetElementVisitor
-
main
public static void main(java.lang.String[] args)
Small sample application that illustrates the use of this class.
-
-