public class TryCatchBlockSorter extends MethodNode
MethodVisitor 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).access, annotationDefault, attrs, desc, exceptions, instructions, invisibleAnnotations, invisibleParameterAnnotations, localVariables, maxLocals, maxStack, name, signature, tryCatchBlocks, visibleAnnotations, visibleParameterAnnotationsapi, mv| 限定符 | 构造器和说明 |
|---|---|
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) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
visitEnd()
Visits the end of the method.
|
accept, accept, check, getLabelNode, visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLookupSwitchInsn, visitMaxs, visitMethodInsn, visitMultiANewArrayInsn, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchBlock, visitTypeInsn, visitVarInsnpublic TryCatchBlockSorter(MethodVisitor mv, int access, java.lang.String name, java.lang.String desc, java.lang.String signature, java.lang.String[] exceptions)
protected TryCatchBlockSorter(int api,
MethodVisitor mv,
int access,
java.lang.String name,
java.lang.String desc,
java.lang.String signature,
java.lang.String[] exceptions)
public void visitEnd()
MethodVisitorvisitEnd 在类中 MethodNode