KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > cglib > transform > NullClassVisitor


1 /*
2  * Copyright 2003 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package net.sf.cglib.transform;
17
18 import org.objectweb.asm.Attribute;
19 import org.objectweb.asm.CodeVisitor;
20 import org.objectweb.asm.ClassVisitor;
21 import org.objectweb.asm.Label;
22
23 public class NullClassVisitor implements ClassVisitor {
24     public static final NullClassVisitor INSTANCE = new NullClassVisitor();
25     
26     public void visit(int version, int access, String JavaDoc name, String JavaDoc superName, String JavaDoc[] interfaces, String JavaDoc sourceFile) { }
27     public void visitEnd() { }
28     public void visitField(int access, String JavaDoc name, String JavaDoc desc, Object JavaDoc value, Attribute attrs) { }
29     public void visitInnerClass(String JavaDoc name, String JavaDoc outerName, String JavaDoc innerName, int access) { }
30     public void visitAttribute(Attribute attrs) { }
31
32     public CodeVisitor visitMethod(int access, String JavaDoc name, String JavaDoc desc, String JavaDoc[] exceptions, Attribute attrs) {
33         return NullCodeVisitor.INSTANCE;
34     }
35
36     private static class NullCodeVisitor implements CodeVisitor {
37         public static final NullCodeVisitor INSTANCE = new NullCodeVisitor();
38         
39         public void visitFieldInsn(int opcode, String JavaDoc owner, String JavaDoc name, String JavaDoc desc) { }
40         public void visitIincInsn(int var, int increment) { }
41         public void visitInsn(int opcode) { }
42         public void visitIntInsn(int opcode, int operand) { }
43         public void visitJumpInsn(int opcode, Label label) { }
44         public void visitLabel(Label label) { }
45         public void visitLdcInsn(Object JavaDoc cst) { }
46         public void visitLineNumber(int line, Label start) { }
47         public void visitLocalVariable(String JavaDoc name, String JavaDoc desc, Label start, Label end, int index) { }
48         public void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels) { }
49         public void visitMaxs(int maxStack, int maxLocals) { }
50         public void visitMethodInsn(int opcode, String JavaDoc owner, String JavaDoc name, String JavaDoc desc) { }
51         public void visitMultiANewArrayInsn(String JavaDoc desc, int dims) { }
52         public void visitTableSwitchInsn(int min, int max, Label dflt, Label[] labels) { }
53         public void visitTryCatchBlock(Label start, Label end, Label handler, String JavaDoc type) { }
54         public void visitTypeInsn(int opcode, String JavaDoc desc) { }
55         public void visitVarInsn(int opcode, int var) { }
56         public void visitAttribute(Attribute attrs) { }
57     }
58 }
59
Popular Tags