Package org.objectweb.asm.commons
Class TryCatchBlockSorter
- java.lang.Object
-
- org.objectweb.asm.MethodVisitor
-
- org.objectweb.asm.tree.MethodNode
-
- org.objectweb.asm.commons.TryCatchBlockSorter
-
public class TryCatchBlockSorter extends MethodNode
AMethodVisitor
adapter to sort the exception handlers. The handlers are sorted 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 org.objectweb.asm.tree.MethodNode
access, annotationDefault, attrs, desc, exceptions, instructions, invisibleAnnotations, invisibleLocalVariableAnnotations, invisibleParameterAnnotations, invisibleTypeAnnotations, localVariables, maxLocals, maxStack, name, parameters, signature, tryCatchBlocks, visibleAnnotations, visibleLocalVariableAnnotations, visibleParameterAnnotations, visibleTypeAnnotations
-
Fields inherited from class org.objectweb.asm.MethodVisitor
api, mv
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TryCatchBlockSorter(int api, MethodVisitor mv, int access, java.lang.String name, java.lang.String desc, java.lang.String signature, java.lang.String[] exceptions)
TryCatchBlockSorter(MethodVisitor mv, int access, java.lang.String name, java.lang.String desc, java.lang.String signature, java.lang.String[] exceptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
visitEnd()
Visits the end of the method.-
Methods inherited from class org.objectweb.asm.tree.MethodNode
accept, accept, check, getLabelNode, visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMaxs, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitParameter, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation, visitTypeInsn, visitVarInsn
-
-
-
-
Constructor Detail
-
TryCatchBlockSorter
public TryCatchBlockSorter(MethodVisitor mv, int access, java.lang.String name, java.lang.String desc, java.lang.String signature, java.lang.String[] exceptions)
-
TryCatchBlockSorter
protected TryCatchBlockSorter(int api, MethodVisitor mv, int access, java.lang.String name, java.lang.String desc, java.lang.String signature, java.lang.String[] exceptions)
-
-
Method Detail
-
visitEnd
public void visitEnd()
Description copied from class:MethodVisitor
Visits the end of the method. This method, which is the last one to be called, is used to inform the visitor that all the annotations and attributes of the method have been visited.- Overrides:
visitEnd
in classMethodNode
-
-