1 /* 2 * Copyright 2003-2010 the original author or authors. 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 com.tonicsystems.jarjar; 17 18 import org.objectweb.asm.Opcodes; 19 import org.objectweb.asm.AnnotationVisitor; 20 import org.objectweb.asm.ClassVisitor; 21 import org.objectweb.asm.FieldVisitor; 22 import org.objectweb.asm.MethodVisitor; 23 24 /** 25 * An ASM3 EmptyVisitor replacement 26 * 27 * @author <a href="mailto:blackdrag@gmx.org">Jochen "blackdrag" Theodorou</a> 28 */ 29 public class EmptyClassVisitor extends ClassVisitor { 30 EmptyClassVisitor()31 public EmptyClassVisitor() { 32 super(Opcodes.ASM9); 33 } 34 35 @Override visitMethod( int access, String name, String desc, String signature, String[] exceptions)36 public MethodVisitor visitMethod( 37 int access, String name, String desc, String signature, String[] exceptions) { 38 return new MethodVisitor(Opcodes.ASM9) {}; 39 } 40 41 @Override visitAnnotation(String desc, boolean visible)42 public AnnotationVisitor visitAnnotation(String desc, boolean visible) { 43 return new AnnotationVisitor(Opcodes.ASM9) {}; 44 } 45 46 @Override visitField( int access, String name, String desc, String signature, Object value)47 public FieldVisitor visitField( 48 int access, String name, String desc, String signature, Object value) { 49 return new FieldVisitor(Opcodes.ASM9) {}; 50 } 51 } 52