类 TryCatchBlockSorter


public class TryCatchBlockSorter extends MethodNode
A 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).

作者:
Adrian Sampson
  • 构造器详细资料

    • TryCatchBlockSorter

      public TryCatchBlockSorter(MethodVisitor methodVisitor, int access, String name, String descriptor, String signature, String[] exceptions)
      Constructs a new TryCatchBlockSorter.
      参数:
      methodVisitor - the method visitor to which this visitor must delegate method calls. May be null.
      access - the method's access flags (see Opcodes). This parameter also indicates if the method is synthetic and/or deprecated.
      name - the method's name.
      descriptor - the method's descriptor (see Type).
      signature - the method's signature. May be null if the method parameters, return type and exceptions do not use generic types.
      exceptions - the internal names of the method's exception classes (see Type.getInternalName()). May be null.
  • 方法详细资料

    • visitEnd

      public void visitEnd()
      从类复制的说明: 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.
      覆盖:
      visitEnd 在类中 MethodNode