1 /* 2 * ProGuard -- shrinking, optimization, obfuscation, and preverification 3 * of Java bytecode. 4 * 5 * Copyright (c) 2002-2014 Eric Lafortune (eric@graphics.cornell.edu) 6 * 7 * This program is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU General Public License as published by the Free 9 * Software Foundation; either version 2 of the License, or (at your option) 10 * any later version. 11 * 12 * This program is distributed in the hope that it will be useful, but WITHOUT 13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 15 * more details. 16 * 17 * You should have received a copy of the GNU General Public License along 18 * with this program; if not, write to the Free Software Foundation, Inc., 19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 */ 21 package proguard.classfile.attribute.visitor; 22 23 import proguard.classfile.*; 24 import proguard.classfile.attribute.*; 25 import proguard.classfile.attribute.annotation.*; 26 import proguard.classfile.attribute.preverification.*; 27 28 /** 29 * This interface specifies the methods for a visitor of <code>Attribute</code> 30 * objects. 31 * 32 * @author Eric Lafortune 33 */ 34 public interface AttributeVisitor 35 { 36 // Attributes that are attached to classes. 37 visitUnknownAttribute( Clazz clazz, UnknownAttribute unknownAttribute)38 public void visitUnknownAttribute( Clazz clazz, UnknownAttribute unknownAttribute); visitBootstrapMethodsAttribute( Clazz clazz, BootstrapMethodsAttribute bootstrapMethodsAttribute)39 public void visitBootstrapMethodsAttribute( Clazz clazz, BootstrapMethodsAttribute bootstrapMethodsAttribute); visitSourceFileAttribute( Clazz clazz, SourceFileAttribute sourceFileAttribute)40 public void visitSourceFileAttribute( Clazz clazz, SourceFileAttribute sourceFileAttribute); visitSourceDirAttribute( Clazz clazz, SourceDirAttribute sourceDirAttribute)41 public void visitSourceDirAttribute( Clazz clazz, SourceDirAttribute sourceDirAttribute); visitInnerClassesAttribute( Clazz clazz, InnerClassesAttribute innerClassesAttribute)42 public void visitInnerClassesAttribute( Clazz clazz, InnerClassesAttribute innerClassesAttribute); visitEnclosingMethodAttribute( Clazz clazz, EnclosingMethodAttribute enclosingMethodAttribute)43 public void visitEnclosingMethodAttribute( Clazz clazz, EnclosingMethodAttribute enclosingMethodAttribute); 44 45 // Attributes that are attached to classes, fields, and methods. 46 visitDeprecatedAttribute( Clazz clazz, DeprecatedAttribute deprecatedAttribute)47 public void visitDeprecatedAttribute( Clazz clazz, DeprecatedAttribute deprecatedAttribute); visitDeprecatedAttribute( Clazz clazz, Field field, DeprecatedAttribute deprecatedAttribute)48 public void visitDeprecatedAttribute( Clazz clazz, Field field, DeprecatedAttribute deprecatedAttribute); visitDeprecatedAttribute( Clazz clazz, Method method, DeprecatedAttribute deprecatedAttribute)49 public void visitDeprecatedAttribute( Clazz clazz, Method method, DeprecatedAttribute deprecatedAttribute); 50 visitSyntheticAttribute( Clazz clazz, SyntheticAttribute syntheticAttribute)51 public void visitSyntheticAttribute( Clazz clazz, SyntheticAttribute syntheticAttribute); visitSyntheticAttribute( Clazz clazz, Field field, SyntheticAttribute syntheticAttribute)52 public void visitSyntheticAttribute( Clazz clazz, Field field, SyntheticAttribute syntheticAttribute); visitSyntheticAttribute( Clazz clazz, Method method, SyntheticAttribute syntheticAttribute)53 public void visitSyntheticAttribute( Clazz clazz, Method method, SyntheticAttribute syntheticAttribute); 54 visitSignatureAttribute( Clazz clazz, SignatureAttribute signatureAttribute)55 public void visitSignatureAttribute( Clazz clazz, SignatureAttribute signatureAttribute); visitSignatureAttribute( Clazz clazz, Field field, SignatureAttribute signatureAttribute)56 public void visitSignatureAttribute( Clazz clazz, Field field, SignatureAttribute signatureAttribute); visitSignatureAttribute( Clazz clazz, Method method, SignatureAttribute signatureAttribute)57 public void visitSignatureAttribute( Clazz clazz, Method method, SignatureAttribute signatureAttribute); 58 59 // Attributes that are attached to fields. 60 visitConstantValueAttribute( Clazz clazz, Field field, ConstantValueAttribute constantValueAttribute)61 public void visitConstantValueAttribute( Clazz clazz, Field field, ConstantValueAttribute constantValueAttribute); 62 63 // Attributes that are attached to methods. 64 visitMethodParametersAttribute( Clazz clazz, Method method, MethodParametersAttribute methodParametersAttribute)65 public void visitMethodParametersAttribute( Clazz clazz, Method method, MethodParametersAttribute methodParametersAttribute); visitExceptionsAttribute( Clazz clazz, Method method, ExceptionsAttribute exceptionsAttribute)66 public void visitExceptionsAttribute( Clazz clazz, Method method, ExceptionsAttribute exceptionsAttribute); visitCodeAttribute( Clazz clazz, Method method, CodeAttribute codeAttribute)67 public void visitCodeAttribute( Clazz clazz, Method method, CodeAttribute codeAttribute); 68 69 // Attributes that are attached to code attributes. 70 visitStackMapAttribute( Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapAttribute stackMapAttribute)71 public void visitStackMapAttribute( Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapAttribute stackMapAttribute); visitStackMapTableAttribute( Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapTableAttribute stackMapTableAttribute)72 public void visitStackMapTableAttribute( Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapTableAttribute stackMapTableAttribute); visitLineNumberTableAttribute( Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)73 public void visitLineNumberTableAttribute( Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute); visitLocalVariableTableAttribute( Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTableAttribute localVariableTableAttribute)74 public void visitLocalVariableTableAttribute( Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTableAttribute localVariableTableAttribute); visitLocalVariableTypeTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeTableAttribute localVariableTypeTableAttribute)75 public void visitLocalVariableTypeTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeTableAttribute localVariableTypeTableAttribute); 76 77 // Annotation attributes. 78 visitRuntimeVisibleAnnotationsAttribute( Clazz clazz, RuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute)79 public void visitRuntimeVisibleAnnotationsAttribute( Clazz clazz, RuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute); visitRuntimeVisibleAnnotationsAttribute( Clazz clazz, Field field, RuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute)80 public void visitRuntimeVisibleAnnotationsAttribute( Clazz clazz, Field field, RuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute); visitRuntimeVisibleAnnotationsAttribute( Clazz clazz, Method method, RuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute)81 public void visitRuntimeVisibleAnnotationsAttribute( Clazz clazz, Method method, RuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute); 82 visitRuntimeInvisibleAnnotationsAttribute( Clazz clazz, RuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute)83 public void visitRuntimeInvisibleAnnotationsAttribute( Clazz clazz, RuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute); visitRuntimeInvisibleAnnotationsAttribute( Clazz clazz, Field field, RuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute)84 public void visitRuntimeInvisibleAnnotationsAttribute( Clazz clazz, Field field, RuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute); visitRuntimeInvisibleAnnotationsAttribute( Clazz clazz, Method method, RuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute)85 public void visitRuntimeInvisibleAnnotationsAttribute( Clazz clazz, Method method, RuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute); 86 visitRuntimeVisibleParameterAnnotationsAttribute( Clazz clazz, Method method, RuntimeVisibleParameterAnnotationsAttribute runtimeVisibleParameterAnnotationsAttribute)87 public void visitRuntimeVisibleParameterAnnotationsAttribute( Clazz clazz, Method method, RuntimeVisibleParameterAnnotationsAttribute runtimeVisibleParameterAnnotationsAttribute); visitRuntimeInvisibleParameterAnnotationsAttribute(Clazz clazz, Method method, RuntimeInvisibleParameterAnnotationsAttribute runtimeInvisibleParameterAnnotationsAttribute)88 public void visitRuntimeInvisibleParameterAnnotationsAttribute(Clazz clazz, Method method, RuntimeInvisibleParameterAnnotationsAttribute runtimeInvisibleParameterAnnotationsAttribute); 89 visitRuntimeVisibleTypeAnnotationsAttribute( Clazz clazz, RuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute)90 public void visitRuntimeVisibleTypeAnnotationsAttribute( Clazz clazz, RuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute); visitRuntimeVisibleTypeAnnotationsAttribute( Clazz clazz, Field field, RuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute)91 public void visitRuntimeVisibleTypeAnnotationsAttribute( Clazz clazz, Field field, RuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute); visitRuntimeVisibleTypeAnnotationsAttribute( Clazz clazz, Method method, RuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute)92 public void visitRuntimeVisibleTypeAnnotationsAttribute( Clazz clazz, Method method, RuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute); visitRuntimeVisibleTypeAnnotationsAttribute( Clazz clazz, Method method, CodeAttribute codeAttribute, RuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute)93 public void visitRuntimeVisibleTypeAnnotationsAttribute( Clazz clazz, Method method, CodeAttribute codeAttribute, RuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute); 94 visitRuntimeInvisibleTypeAnnotationsAttribute( Clazz clazz, RuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute)95 public void visitRuntimeInvisibleTypeAnnotationsAttribute( Clazz clazz, RuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute); visitRuntimeInvisibleTypeAnnotationsAttribute( Clazz clazz, Field field, RuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute)96 public void visitRuntimeInvisibleTypeAnnotationsAttribute( Clazz clazz, Field field, RuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute); visitRuntimeInvisibleTypeAnnotationsAttribute( Clazz clazz, Method method, RuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute)97 public void visitRuntimeInvisibleTypeAnnotationsAttribute( Clazz clazz, Method method, RuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute); visitRuntimeInvisibleTypeAnnotationsAttribute( Clazz clazz, Method method, CodeAttribute codeAttribute, RuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute)98 public void visitRuntimeInvisibleTypeAnnotationsAttribute( Clazz clazz, Method method, CodeAttribute codeAttribute, RuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute); 99 visitAnnotationDefaultAttribute( Clazz clazz, Method method, AnnotationDefaultAttribute annotationDefaultAttribute)100 public void visitAnnotationDefaultAttribute( Clazz clazz, Method method, AnnotationDefaultAttribute annotationDefaultAttribute); 101 } 102