< prev index next >

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

Print this page




  45  *    this software without specific prior written permission.
  46  *
  47  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  48  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  49  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  50  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  51  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  52  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  53  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  54  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  55  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  56  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  57  * THE POSSIBILITY OF SUCH DAMAGE.
  58  */
  59 package jdk.internal.org.objectweb.asm;
  60 
  61 /**
  62  * A visitor to visit a Java method. The methods of this class must be called in
  63  * the following order: ( <tt>visitParameter</tt> )* [
  64  * <tt>visitAnnotationDefault</tt> ] ( <tt>visitAnnotation</tt> |
  65  * <tt>visitTypeAnnotation</tt> | <tt>visitAttribute</tt> )* [
  66  * <tt>visitCode</tt> ( <tt>visitFrame</tt> | <tt>visit<i>X</i>Insn</tt> |
  67  * <tt>visitLabel</tt> | <tt>visitInsnAnnotation</tt> |
  68  * <tt>visitTryCatchBlock</tt> | <tt>visitTryCatchBlockAnnotation</tt> |
  69  * <tt>visitLocalVariable</tt> | <tt>visitLocalVariableAnnotation</tt> |
  70  * <tt>visitLineNumber</tt> )* <tt>visitMaxs</tt> ] <tt>visitEnd</tt>. In
  71  * addition, the <tt>visit<i>X</i>Insn</tt> and <tt>visitLabel</tt> methods must
  72  * be called in the sequential order of the bytecode instructions of the visited
  73  * code, <tt>visitInsnAnnotation</tt> must be called <i>after</i> the annotated

  74  * instruction, <tt>visitTryCatchBlock</tt> must be called <i>before</i> the
  75  * labels passed as arguments have been visited,
  76  * <tt>visitTryCatchBlockAnnotation</tt> must be called <i>after</i> the
  77  * corresponding try catch block has been visited, and the
  78  * <tt>visitLocalVariable</tt>, <tt>visitLocalVariableAnnotation</tt> and
  79  * <tt>visitLineNumber</tt> methods must be called <i>after</i> the labels
  80  * passed as arguments have been visited.
  81  *
  82  * @author Eric Bruneton
  83  */
  84 public abstract class MethodVisitor {
  85 
  86     /**
  87      * The ASM API version implemented by this visitor. The value of this field
  88      * must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
  89      */
  90     protected final int api;
  91 
  92     /**
  93      * The method visitor to which this visitor must delegate method calls. May




  45  *    this software without specific prior written permission.
  46  *
  47  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  48  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  49  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  50  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  51  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  52  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  53  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  54  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  55  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  56  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  57  * THE POSSIBILITY OF SUCH DAMAGE.
  58  */
  59 package jdk.internal.org.objectweb.asm;
  60 
  61 /**
  62  * A visitor to visit a Java method. The methods of this class must be called in
  63  * the following order: ( <tt>visitParameter</tt> )* [
  64  * <tt>visitAnnotationDefault</tt> ] ( <tt>visitAnnotation</tt> |
  65  * <tt>visitParameterAnnotation</tt> <tt>visitTypeAnnotation</tt> |
  66  * <tt>visitAttribute</tt> )* [ <tt>visitCode</tt> ( <tt>visitFrame</tt> |
  67  * <tt>visit<i>X</i>Insn</tt> | <tt>visitLabel</tt> |
  68  * <tt>visitInsnAnnotation</tt> | <tt>visitTryCatchBlock</tt> |
  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


< prev index next >