Class TryCatchBlockSorter
java.lang.Object
org.objectweb.asm.tree.MemberNode
org.objectweb.asm.tree.MethodNode
org.objectweb.asm.commons.TryCatchBlockSorter
- All Implemented Interfaces:
MethodVisitor
Sorts the exception handlers in a method innermost-to-outermost. This allows
the programmer to add handlers without worrying about ordering them correctly
with respect to existing, in-code handlers.
Behavior is only defined for properly-nested handlers. If any "try" blocks
overlap (something that isn't possible in Java code) then this may not do
what you want. In fact, this adapter just sorts by the length of the "try"
block, taking advantage of the fact that a given try block must be larger
than any block it contains).
- Author:
- Adrian Sampson
-
Field Summary
Fields inherited from class MethodNode
access, annotationDefault, desc, exceptions, instructions, invisibleParameterAnnotations, localVariables, maxLocals, maxStack, name, signature, tryCatchBlocks, visibleParameterAnnotationsFields inherited from class MemberNode
attrs, invisibleAnnotations, visibleAnnotations -
Constructor Summary
ConstructorsConstructorDescriptionTryCatchBlockSorter(MethodVisitor mv, int access, String name, String desc, String signature, String[] exceptions) -
Method Summary
Methods inherited from class MethodNode
accept, accept, getLabelNode, visitAnnotationDefault, visitCode, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitIntInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLookupSwitchInsn, visitMaxs, visitMethodInsn, visitMultiANewArrayInsn, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchBlock, visitTypeInsn, visitVarInsnMethods inherited from class MemberNode
visitAnnotation, visitAttributeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MethodVisitor
visitAnnotation, visitAttribute
-
Constructor Details
-
TryCatchBlockSorter
public TryCatchBlockSorter(MethodVisitor mv, int access, String name, String desc, String signature, String[] exceptions)
-
-
Method Details
-
visitEnd
public void visitEnd()Description copied from class:MemberNodeVisits the end of this class, field or method.- Specified by:
visitEndin interfaceMethodVisitor- Overrides:
visitEndin classMemberNode
-