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 | Constructor and Description |
|---|---|
| public | TryCatchBlockSorter(final MethodVisitor
the method visitor to which this visitor must delegate method calls. May
be null. methodVisitor, final int the method's access flags (see access, final String Opcodes). This parameter also indicates if
the method is synthetic and/or deprecated.the method's name. name, final String the method's descriptor (see descriptor, final String org.).the method's signature. May be null if the method parameters,
return type and exceptions do not use generic types. signature, final String[] the internal names of the method's exception classes (see exceptions)org.). May be null.Constructs a new |
| protected | TryCatchBlockSorter(final int api, final MethodVisitor methodVisitor, final int access, final String name, final String descriptor, final String signature, final String[] exceptions)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | visitEnd()
Overrides org. |
| TryCatchBlockSorter | back to summary |
|---|---|
| public TryCatchBlockSorter(final MethodVisitor methodVisitor, final int access, final String name, final String descriptor, final String signature, final String[] exceptions) Constructs a new
| |
| TryCatchBlockSorter | back to summary |
|---|---|
| protected TryCatchBlockSorter(final int api, final MethodVisitor methodVisitor, final int access, final String name, final String descriptor, final String signature, final String[] exceptions) | |
| visitEnd | back to summary |
|---|---|
| public void visitEnd() Overrides org. Doc from org. 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.
| |