< prev index next >

src/java.base/share/classes/jdk/internal/org/objectweb/asm/signature/SignatureVisitor.java

Print this page




  51  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  52  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  53  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  54  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  55  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  56  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  57  * THE POSSIBILITY OF SUCH DAMAGE.
  58  */
  59 package jdk.internal.org.objectweb.asm.signature;
  60 
  61 import jdk.internal.org.objectweb.asm.Opcodes;
  62 
  63 /**
  64  * A visitor to visit a generic signature. The methods of this interface must be
  65  * called in one of the three following orders (the last one is the only valid
  66  * order for a {@link SignatureVisitor} that is returned by a method of this
  67  * interface):
  68  * <ul>
  69  * <li><i>ClassSignature</i> = ( <tt>visitFormalTypeParameter</tt>
  70  * <tt>visitClassBound</tt>? <tt>visitInterfaceBound</tt>* )* (
  71  * <tt>visitSuperClass</tt> <tt>visitInterface</tt>* )</li>
  72  * <li><i>MethodSignature</i> = ( <tt>visitFormalTypeParameter</tt>
  73  * <tt>visitClassBound</tt>? <tt>visitInterfaceBound</tt>* )* (
  74  * <tt>visitParameterType</tt>* <tt>visitReturnType</tt>
  75  * <tt>visitExceptionType</tt>* )</li>
  76  * <li><i>TypeSignature</i> = <tt>visitBaseType</tt> |
  77  * <tt>visitTypeVariable</tt> | <tt>visitArrayType</tt> | (
  78  * <tt>visitClassType</tt> <tt>visitTypeArgument</tt>* (
  79  * <tt>visitInnerClassType</tt> <tt>visitTypeArgument</tt>* )* <tt>visitEnd</tt>
  80  * ) )</li>
  81  * </ul>
  82  *
  83  * @author Thomas Hallgren
  84  * @author Eric Bruneton
  85  */
  86 public abstract class SignatureVisitor {
  87 
  88     /**
  89      * Wildcard for an "extends" type argument.
  90      */
  91     public static final char EXTENDS = '+';
  92 
  93     /**
  94      * Wildcard for a "super" type argument.
  95      */
  96     public static final char SUPER = '-';
  97 
  98     /**
  99      * Wildcard for a normal type argument.
 100      */
 101     public static final char INSTANCEOF = '=';
 102 
 103     /**
 104      * The ASM API version implemented by this visitor. The value of this field
 105      * must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
 106      */
 107     protected final int api;
 108 
 109     /**
 110      * Constructs a new {@link SignatureVisitor}.
 111      *
 112      * @param api
 113      *            the ASM API version implemented by this visitor. Must be one
 114      *            of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
 115      */
 116     public SignatureVisitor(final int api) {
 117         if (api != Opcodes.ASM4 && api != Opcodes.ASM5) {
 118             throw new IllegalArgumentException();
 119         }
 120         this.api = api;
 121     }




  51  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  52  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  53  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  54  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  55  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  56  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  57  * THE POSSIBILITY OF SUCH DAMAGE.
  58  */
  59 package jdk.internal.org.objectweb.asm.signature;
  60 
  61 import jdk.internal.org.objectweb.asm.Opcodes;
  62 
  63 /**
  64  * A visitor to visit a generic signature. The methods of this interface must be
  65  * called in one of the three following orders (the last one is the only valid
  66  * order for a {@link SignatureVisitor} that is returned by a method of this
  67  * interface):
  68  * <ul>
  69  * <li><i>ClassSignature</i> = ( <tt>visitFormalTypeParameter</tt>
  70  * <tt>visitClassBound</tt>? <tt>visitInterfaceBound</tt>* )* (
  71  * <tt>visitSuperclass</tt> <tt>visitInterface</tt>* )</li>
  72  * <li><i>MethodSignature</i> = ( <tt>visitFormalTypeParameter</tt>
  73  * <tt>visitClassBound</tt>? <tt>visitInterfaceBound</tt>* )* (
  74  * <tt>visitParameterType</tt>* <tt>visitReturnType</tt>
  75  * <tt>visitExceptionType</tt>* )</li>
  76  * <li><i>TypeSignature</i> = <tt>visitBaseType</tt> |
  77  * <tt>visitTypeVariable</tt> | <tt>visitArrayType</tt> | (
  78  * <tt>visitClassType</tt> <tt>visitTypeArgument</tt>* (
  79  * <tt>visitInnerClassType</tt> <tt>visitTypeArgument</tt>* )* <tt>visitEnd</tt>
  80  * ) )</li>
  81  * </ul>
  82  *
  83  * @author Thomas Hallgren
  84  * @author Eric Bruneton
  85  */
  86 public abstract class SignatureVisitor {
  87 
  88     /**
  89      * Wildcard for an "extends" type argument.
  90      */
  91     public final static char EXTENDS = '+';
  92 
  93     /**
  94      * Wildcard for a "super" type argument.
  95      */
  96     public final static char SUPER = '-';
  97 
  98     /**
  99      * Wildcard for a normal type argument.
 100      */
 101     public final static char INSTANCEOF = '=';
 102 
 103     /**
 104      * The ASM API version implemented by this visitor. The value of this field
 105      * must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
 106      */
 107     protected final int api;
 108 
 109     /**
 110      * Constructs a new {@link SignatureVisitor}.
 111      *
 112      * @param api
 113      *            the ASM API version implemented by this visitor. Must be one
 114      *            of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
 115      */
 116     public SignatureVisitor(final int api) {
 117         if (api != Opcodes.ASM4 && api != Opcodes.ASM5) {
 118             throw new IllegalArgumentException();
 119         }
 120         this.api = api;
 121     }


< prev index next >