View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   *  Unless required by applicable law or agreed to in writing, software
12   *  distributed under the License is distributed on an "AS IS" BASIS,
13   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   *  See the License for the specific language governing permissions and
15   *  limitations under the License.
16   *
17   */
18  package org.apache.bcel.classfile;
19  
20  /**
21   * Interface to make use of the Visitor pattern programming style. I.e. a class
22   * that implements this interface can traverse the contents of a Java class just
23   * by calling the `accept' method which all classes have.
24   *
25   */
26  public interface Visitor
27  {
28      void visitCode(Code obj);
29  
30      void visitCodeException(CodeException obj);
31  
32      void visitConstantClass(ConstantClass obj);
33  
34      void visitConstantDouble(ConstantDouble obj);
35  
36      void visitConstantFieldref(ConstantFieldref obj);
37  
38      void visitConstantFloat(ConstantFloat obj);
39  
40      void visitConstantInteger(ConstantInteger obj);
41  
42      void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj);
43  
44      void visitConstantInvokeDynamic(ConstantInvokeDynamic obj);
45  
46      void visitConstantLong(ConstantLong obj);
47  
48      void visitConstantMethodref(ConstantMethodref obj);
49  
50      void visitConstantNameAndType(ConstantNameAndType obj);
51  
52      void visitConstantPool(ConstantPool obj);
53  
54      void visitConstantString(ConstantString obj);
55  
56      void visitConstantUtf8(ConstantUtf8 obj);
57  
58      void visitConstantValue(ConstantValue obj);
59  
60      void visitDeprecated(Deprecated obj);
61  
62      void visitExceptionTable(ExceptionTable obj);
63  
64      void visitField(Field obj);
65  
66      void visitInnerClass(InnerClass obj);
67  
68      void visitInnerClasses(InnerClasses obj);
69  
70      void visitJavaClass(JavaClass obj);
71  
72      void visitLineNumber(LineNumber obj);
73  
74      void visitLineNumberTable(LineNumberTable obj);
75  
76      void visitLocalVariable(LocalVariable obj);
77  
78      void visitLocalVariableTable(LocalVariableTable obj);
79  
80      void visitMethod(Method obj);
81  
82      void visitSignature(Signature obj);
83  
84      void visitSourceFile(SourceFile obj);
85  
86      void visitSynthetic(Synthetic obj);
87  
88      void visitUnknown(Unknown obj);
89  
90      void visitStackMap(StackMap obj);
91  
92      void visitStackMapEntry(StackMapEntry obj);
93  
94      /**
95       * @since 6.0
96       */
97      void visitAnnotation(Annotations obj);
98  
99      /**
100      * @since 6.0
101      */
102     void visitParameterAnnotation(ParameterAnnotations obj);
103 
104     /**
105      * @since 6.0
106      */
107     void visitAnnotationEntry(AnnotationEntry obj);
108 
109     /**
110      * @since 6.0
111      */
112     void visitAnnotationDefault(AnnotationDefault obj);
113 
114     /**
115      * @since 6.0
116      */
117     void visitLocalVariableTypeTable(LocalVariableTypeTable obj);
118 
119     /**
120      * @since 6.0
121      */
122     void visitEnclosingMethod(EnclosingMethod obj);
123 
124     /**
125      * @since 6.0
126      */
127     void visitBootstrapMethods(BootstrapMethods obj);
128 
129     /**
130      * @since 6.0
131      */
132     void visitMethodParameters(MethodParameters obj);
133 
134     /**
135      * @since 6.4.0
136      */
137     default void visitMethodParameter(final MethodParameter obj) {
138         // empty
139     }
140 
141     /**
142      * @since 6.0
143      */
144     void visitConstantMethodType(ConstantMethodType obj);
145 
146     /**
147      * @since 6.0
148      */
149     void visitConstantMethodHandle(ConstantMethodHandle obj);
150 
151     /**
152      * @since 6.0
153      */
154     void visitParameterAnnotationEntry(ParameterAnnotationEntry obj);
155 
156     /**
157      * @since 6.1
158      */
159     void visitConstantPackage(ConstantPackage constantPackage);
160 
161     /**
162      * @since 6.1
163      */
164     void visitConstantModule(ConstantModule constantModule);
165 
166     /**
167      * @since 6.3
168      */
169     default void visitConstantDynamic(final ConstantDynamic constantDynamic) {
170         // empty
171     }
172 
173     /**
174      * @since 6.4.0
175      */
176     default void visitModule(final Module constantModule) {
177         // empty
178     }
179 
180     /**
181      * @since 6.4.0
182      */
183     default void visitModuleRequires(final ModuleRequires constantModule) {
184         // empty
185     }
186 
187     /**
188      * @since 6.4.0
189      */
190     default void visitModuleExports(final ModuleExports constantModule) {
191         // empty
192     }
193 
194     /**
195      * @since 6.4.0
196      */
197     default void visitModuleOpens(final ModuleOpens constantModule) {
198         // empty
199     }
200 
201     /**
202      * @since 6.4.0
203      */
204     default void visitModuleProvides(final ModuleProvides constantModule) {
205         // empty
206     }
207 
208     /**
209      * @since 6.4.0
210      */
211     default void visitModulePackages(final ModulePackages constantModule) {
212         // empty
213     }
214 
215     /**
216      * @since 6.4.0
217      */
218     default void visitModuleMainClass(final ModuleMainClass obj) {
219         // empty
220     }
221 
222     /**
223      * @since 6.4.0
224      */
225     default void visitNestHost(final NestHost obj) {
226         // empty
227     }
228 
229     /**
230      * @since 6.4.0
231      */
232     default void visitNestMembers(final NestMembers obj) {
233         // empty
234     }
235 }