< prev index next >

src/java.base/share/classes/jdk/internal/org/objectweb/asm/MethodVisitor.java

Print this page
rev 47452 : imported patch jdk-new-asmv6.patch


  69  * <tt>visitTryCatchAnnotation</tt> | <tt>visitLocalVariable</tt> |
  70  * <tt>visitLocalVariableAnnotation</tt> | <tt>visitLineNumber</tt> )*
  71  * <tt>visitMaxs</tt> ] <tt>visitEnd</tt>. In addition, the
  72  * <tt>visit<i>X</i>Insn</tt> and <tt>visitLabel</tt> methods must be called in
  73  * the sequential order of the bytecode instructions of the visited code,
  74  * <tt>visitInsnAnnotation</tt> must be called <i>after</i> the annotated
  75  * instruction, <tt>visitTryCatchBlock</tt> must be called <i>before</i> the
  76  * labels passed as arguments have been visited,
  77  * <tt>visitTryCatchBlockAnnotation</tt> must be called <i>after</i> the
  78  * corresponding try catch block has been visited, and the
  79  * <tt>visitLocalVariable</tt>, <tt>visitLocalVariableAnnotation</tt> and
  80  * <tt>visitLineNumber</tt> methods must be called <i>after</i> the labels
  81  * passed as arguments have been visited.
  82  *
  83  * @author Eric Bruneton
  84  */
  85 public abstract class MethodVisitor {
  86 
  87     /**
  88      * The ASM API version implemented by this visitor. The value of this field
  89      * must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
  90      */
  91     protected final int api;
  92 
  93     /**
  94      * The method visitor to which this visitor must delegate method calls. May
  95      * be null.
  96      */
  97     protected MethodVisitor mv;
  98 
  99     /**
 100      * Constructs a new {@link MethodVisitor}.
 101      *
 102      * @param api
 103      *            the ASM API version implemented by this visitor. Must be one
 104      *            of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
 105      */
 106     public MethodVisitor(final int api) {
 107         this(api, null);
 108     }
 109 
 110     /**
 111      * Constructs a new {@link MethodVisitor}.
 112      *
 113      * @param api
 114      *            the ASM API version implemented by this visitor. Must be one
 115      *            of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
 116      * @param mv
 117      *            the method visitor to which this visitor must delegate method
 118      *            calls. May be null.
 119      */
 120     public MethodVisitor(final int api, final MethodVisitor mv) {
 121         if (api != Opcodes.ASM4 && api != Opcodes.ASM5) {
 122             throw new IllegalArgumentException();
 123         }
 124         this.api = api;
 125         this.mv = mv;
 126     }
 127 
 128     // -------------------------------------------------------------------------
 129     // Parameters, annotations and non standard attributes
 130     // -------------------------------------------------------------------------
 131 
 132     /**
 133      * Visits a parameter of this method.
 134      *
 135      * @param name
 136      *            parameter name or null if none is provided.
 137      * @param access
 138      *            the parameter's access flags, only <tt>ACC_FINAL</tt>,
 139      *            <tt>ACC_SYNTHETIC</tt> or/and <tt>ACC_MANDATED</tt> are
 140      *            allowed (see {@link Opcodes}).
 141      */




  69  * <tt>visitTryCatchAnnotation</tt> | <tt>visitLocalVariable</tt> |
  70  * <tt>visitLocalVariableAnnotation</tt> | <tt>visitLineNumber</tt> )*
  71  * <tt>visitMaxs</tt> ] <tt>visitEnd</tt>. In addition, the
  72  * <tt>visit<i>X</i>Insn</tt> and <tt>visitLabel</tt> methods must be called in
  73  * the sequential order of the bytecode instructions of the visited code,
  74  * <tt>visitInsnAnnotation</tt> must be called <i>after</i> the annotated
  75  * instruction, <tt>visitTryCatchBlock</tt> must be called <i>before</i> the
  76  * labels passed as arguments have been visited,
  77  * <tt>visitTryCatchBlockAnnotation</tt> must be called <i>after</i> the
  78  * corresponding try catch block has been visited, and the
  79  * <tt>visitLocalVariable</tt>, <tt>visitLocalVariableAnnotation</tt> and
  80  * <tt>visitLineNumber</tt> methods must be called <i>after</i> the labels
  81  * passed as arguments have been visited.
  82  *
  83  * @author Eric Bruneton
  84  */
  85 public abstract class MethodVisitor {
  86 
  87     /**
  88      * The ASM API version implemented by this visitor. The value of this field
  89      * must be one of {@link Opcodes#ASM4}, {@link Opcodes#ASM5} or {@link Opcodes#ASM6}.
  90      */
  91     protected final int api;
  92 
  93     /**
  94      * The method visitor to which this visitor must delegate method calls. May
  95      * be null.
  96      */
  97     protected MethodVisitor mv;
  98 
  99     /**
 100      * Constructs a new {@link MethodVisitor}.
 101      *
 102      * @param api
 103      *            the ASM API version implemented by this visitor. Must be one
 104      *            of {@link Opcodes#ASM4}, {@link Opcodes#ASM5} or {@link Opcodes#ASM6}.
 105      */
 106     public MethodVisitor(final int api) {
 107         this(api, null);
 108     }
 109 
 110     /**
 111      * Constructs a new {@link MethodVisitor}.
 112      *
 113      * @param api
 114      *            the ASM API version implemented by this visitor. Must be one
 115      *            of {@link Opcodes#ASM4}, {@link Opcodes#ASM5} or {@link Opcodes#ASM6}.
 116      * @param mv
 117      *            the method visitor to which this visitor must delegate method
 118      *            calls. May be null.
 119      */
 120     public MethodVisitor(final int api, final MethodVisitor mv) {
 121         if (api < Opcodes.ASM4 || api > Opcodes.ASM6) {
 122             throw new IllegalArgumentException();
 123         }
 124         this.api = api;
 125         this.mv = mv;
 126     }
 127 
 128     // -------------------------------------------------------------------------
 129     // Parameters, annotations and non standard attributes
 130     // -------------------------------------------------------------------------
 131 
 132     /**
 133      * Visits a parameter of this method.
 134      *
 135      * @param name
 136      *            parameter name or null if none is provided.
 137      * @param access
 138      *            the parameter's access flags, only <tt>ACC_FINAL</tt>,
 139      *            <tt>ACC_SYNTHETIC</tt> or/and <tt>ACC_MANDATED</tt> are
 140      *            allowed (see {@link Opcodes}).
 141      */


< prev index next >