Home | History | Annotate | Download | only in commons
      1 /***
      2  * ASM: a very small and fast Java bytecode manipulation framework
      3  * Copyright (c) 2000-2005 INRIA, France Telecom
      4  * All rights reserved.
      5  *
      6  * Redistribution and use in source and binary forms, with or without
      7  * modification, are permitted provided that the following conditions
      8  * are met:
      9  * 1. Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  * 2. Redistributions in binary form must reproduce the above copyright
     12  *    notice, this list of conditions and the following disclaimer in the
     13  *    documentation and/or other materials provided with the distribution.
     14  * 3. Neither the name of the copyright holders nor the names of its
     15  *    contributors may be used to endorse or promote products derived from
     16  *    this software without specific prior written permission.
     17  *
     18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     28  * THE POSSIBILITY OF SUCH DAMAGE.
     29  */
     30 package org.objectweb.asm.commons;
     31 
     32 import org.objectweb.asm.AnnotationVisitor;
     33 import org.objectweb.asm.Attribute;
     34 import org.objectweb.asm.ClassVisitor;
     35 import org.objectweb.asm.Handle;
     36 import org.objectweb.asm.TypeAnnotationVisitor;
     37 import org.objectweb.asm.FieldVisitor;
     38 import org.objectweb.asm.Label;
     39 import org.objectweb.asm.MethodVisitor;
     40 import org.objectweb.asm.PrecompiledMethodVisitor;
     41 import org.objectweb.asm.TypePath;
     42 
     43 import com.sun.tools.javac.code.TypeAnnotationPosition.TypePathEntry;
     44 
     45 /**
     46  * An empty implementation of the ASM visitor interfaces.
     47  *
     48  * @author Eric Bruneton
     49  */
     50 public class EmptyVisitor implements
     51         ClassVisitor,
     52         FieldVisitor,
     53         PrecompiledMethodVisitor, // changed from MethodVisitor
     54         AnnotationVisitor,
     55         TypeAnnotationVisitor // jaime
     56 {
     57 
     58     public void visit(
     59         int version,
     60         int access,
     61         String name,
     62         String signature,
     63         String superName,
     64         String[] interfaces)
     65     {
     66     }
     67 
     68     public void visitSource(String source, String debug) {
     69     }
     70 
     71     public void visitOuterClass(String owner, String name, String desc) {
     72     }
     73 
     74     public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
     75         return this;
     76     }
     77 
     78     // jaime
     79     public TypeAnnotationVisitor visitTypeAnnotation(String desc,
     80         boolean visible,
     81         boolean inCode)
     82     {
     83         return this;
     84     }
     85     //end jaime
     86 
     87     public void visitAttribute(Attribute attr) {
     88     }
     89 
     90     public void visitInnerClass(
     91         String name,
     92         String outerName,
     93         String innerName,
     94         int access)
     95     {
     96     }
     97 
     98     public FieldVisitor visitField(
     99         int access,
    100         String name,
    101         String desc,
    102         String signature,
    103         Object value)
    104     {
    105         return this;
    106     }
    107 
    108     public MethodVisitor visitMethod(
    109         int access,
    110         String name,
    111         String desc,
    112         String signature,
    113         String[] exceptions)
    114     {
    115         return this;
    116     }
    117 
    118     public void visitEnd() {
    119     }
    120 
    121     public AnnotationVisitor visitAnnotationDefault() {
    122         return this;
    123     }
    124 
    125     public AnnotationVisitor visitParameterAnnotation(
    126         int parameter,
    127         String desc,
    128         boolean visible)
    129     {
    130         return this;
    131     }
    132 
    133     public void visitCode() {
    134     }
    135 
    136     public void visitCurrentPosition(int position) {
    137     }
    138 
    139     public void visitInsn(int opcode) {
    140     }
    141 
    142     public void visitIntInsn(int opcode, int operand) {
    143     }
    144 
    145     public void visitVarInsn(int opcode, int var) {
    146     }
    147 
    148     public void visitTypeInsn(int opcode, String desc) {
    149     }
    150 
    151     public void visitFieldInsn(
    152         int opcode,
    153         String owner,
    154         String name,
    155         String desc)
    156     {
    157     }
    158 
    159     public void visitMethodInsn(
    160         int opcode,
    161         String owner,
    162         String name,
    163         String desc)
    164     {
    165     }
    166 
    167     @Override
    168     public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
    169         Object... bsmArgs) {
    170     }
    171 
    172     public void visitJumpInsn(int opcode, Label label) {
    173     }
    174 
    175     public void visitLabel(Label label) {
    176     }
    177 
    178     public void visitLdcInsn(Object cst) {
    179     }
    180 
    181     public void visitIincInsn(int var, int increment) {
    182     }
    183 
    184     public void visitTableSwitchInsn(
    185         int min,
    186         int max,
    187         Label dflt,
    188         Label labels[])
    189     {
    190     }
    191 
    192     public void visitLookupSwitchInsn(Label dflt, int keys[], Label labels[]) {
    193     }
    194 
    195     public void visitMultiANewArrayInsn(String desc, int dims) {
    196     }
    197 
    198     public void visitInvokeDynamicInsn(int a, int b) {
    199     }
    200 
    201     @Override
    202     public AnnotationVisitor visitInsnAnnotation(
    203         int typeRef,
    204         TypePath typePath,
    205         String desc,
    206         boolean visible)
    207     {
    208         return this;
    209     }
    210 
    211     public void visitTryCatchBlock(
    212         Label start,
    213         Label end,
    214         Label handler,
    215         String type)
    216     {
    217     }
    218 
    219     public void visitLocalVariable(
    220         String name,
    221         String desc,
    222         String signature,
    223         Label start,
    224         Label end,
    225         int index)
    226     {
    227     }
    228 
    229     public void visitLineNumber(int line, Label start) {
    230     }
    231 
    232     public void visitMaxs(int maxStack, int maxLocals) {
    233     }
    234 
    235     public void visit(String name, Object value) {
    236     }
    237 
    238     public void visitEnum(String name, String desc, String value) {
    239     }
    240 
    241     public AnnotationVisitor visitAnnotation(String name, String desc) {
    242         return this;
    243     }
    244 
    245     public AnnotationVisitor visitArray(String name) {
    246         return this;
    247     }
    248 
    249     //jaime
    250     public void visitXTargetType(int target_type) {
    251     }
    252     public void visitXOffset(int offset) {
    253     }
    254     public void visitXLocationLength(int location_length) {
    255     }
    256     public void visitXLocation(TypePathEntry location) {
    257     }
    258     public void visitXNumEntries(int num_entries) {
    259     }
    260     public void visitXStartPc(int start_pc) {
    261     }
    262     public void visitXLength(int length) {
    263     }
    264     public void visitXIndex(int index) {
    265     }
    266     public void visitXParamIndex(int param_index) {
    267     }
    268     public void visitXBoundIndex(int bound_index) {
    269     }
    270     public void visitXTypeIndex(int type_index) {
    271     }
    272     //end jaime
    273     public void visitXExceptionIndex(int exception_index) {
    274     }
    275     public void visitXNameAndArgsSize() {
    276     }
    277 }
    278