2 * ASM: a very small and fast Java bytecode manipulation framework
3 * Copyright (c) 2000-2005 INRIA, France Telecom
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
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.
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.
30 package org.objectweb.asm.signature;
33 * A visitor to visit a generic signature. The methods of this interface must be
34 * called in one of the three following orders (the last one is the only valid
35 * order for a {@link SignatureVisitor} that is returned by a method of this
36 * interface): <ul> <li><i>ClassSignature</i> = (
37 * <tt>visitFormalTypeParameter</tt>
38 * <tt>visitClassBound</tt>?
39 * <tt>visitInterfaceBound</tt>* )* ( <tt>visitSuperClass</tt>
40 * <tt>visitInterface</tt>* )</li>
41 * <li><i>MethodSignature</i> = ( <tt>visitFormalTypeParameter</tt>
42 * <tt>visitClassBound</tt>?
43 * <tt>visitInterfaceBound</tt>* )* ( <tt>visitParameterType</tt>*
44 * <tt>visitReturnType</tt>
45 * <tt>visitExceptionType</tt>* )</li> <li><i>TypeSignature</i> =
46 * <tt>visitBaseType</tt> | <tt>visitTypeVariable</tt> |
47 * <tt>visitArrayType</tt> | (
48 * <tt>visitClassType</tt> <tt>visitTypeArgument</tt>* (
49 * <tt>visitInnerClassType</tt> <tt>visitTypeArgument</tt>* )*
50 * <tt>visitEnd</tt> ) )</li> </ul>
52 * @author Thomas Hallgren
53 * @author Eric Bruneton
55 public interface SignatureVisitor {
58 * Wildcard for an "extends" type argument.
63 * Wildcard for a "super" type argument.
68 * Wildcard for a normal type argument.
70 char INSTANCEOF = '=';
73 * Visits a formal type parameter.
75 * @param name the name of the formal parameter.
77 void visitFormalTypeParameter(String name);
80 * Visits the class bound of the last visited formal type parameter.
82 * @return a non null visitor to visit the signature of the class bound.
84 SignatureVisitor visitClassBound();
87 * Visits an interface bound of the last visited formal type parameter.
89 * @return a non null visitor to visit the signature of the interface bound.
91 SignatureVisitor visitInterfaceBound();
94 * Visits the type of the super class.
96 * @return a non null visitor to visit the signature of the super class
99 SignatureVisitor visitSuperclass();
102 * Visits the type of an interface implemented by the class.
104 * @return a non null visitor to visit the signature of the interface type.
106 SignatureVisitor visitInterface();
109 * Visits the type of a method parameter.
111 * @return a non null visitor to visit the signature of the parameter type.
113 SignatureVisitor visitParameterType();
116 * Visits the return type of the method.
118 * @return a non null visitor to visit the signature of the return type.
120 SignatureVisitor visitReturnType();
123 * Visits the type of a method exception.
125 * @return a non null visitor to visit the signature of the exception type.
127 SignatureVisitor visitExceptionType();
130 * Visits a signature corresponding to a primitive type.
132 * @param descriptor the descriptor of the primitive type, or 'V' for
135 void visitBaseType(char descriptor);
138 * Visits a signature corresponding to a type variable.
140 * @param name the name of the type variable.
142 void visitTypeVariable(String name);
145 * Visits a signature corresponding to an array type.
147 * @return a non null visitor to visit the signature of the array element
150 SignatureVisitor visitArrayType();
153 * Starts the visit of a signature corresponding to a class or interface
156 * @param name the internal name of the class or interface.
158 void visitClassType(String name);
161 * Visits an inner class.
163 * @param name the local name of the inner class in its enclosing class.
165 void visitInnerClassType(String name);
168 * Visits an unbounded type argument of the last visited class or inner
171 void visitTypeArgument();
174 * Visits a type argument of the last visited class or inner class type.
176 * @param wildcard '+', '-' or '='.
177 * @return a non null visitor to visit the signature of the type argument.
179 SignatureVisitor visitTypeArgument(char wildcard);
182 * Ends the visit of a signature corresponding to a class or interface type.