Top Description Inners Fields Constructors Methods
org.objectweb.asm.util

public Class CheckSignatureAdapter

extends SignatureVisitor
Class Inheritance
Imports
java.util.EnumSet, org.objectweb.asm.Opcodes, org.objectweb.asm.signature.SignatureVisitor

A SignatureVisitor that checks that its methods are properly used.
Author
Eric Bruneton

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum
CheckSignatureAdapter.State

The possible states of the automaton used to check the order of method calls.

Field Summary

Modifier and TypeField and Description
private boolean
canBeVoid

Whether the visited signature can be 'V'.

public static final int
CLASS_SIGNATURE

Type to be used to check class signatures.

private static final String
public static final int
METHOD_SIGNATURE

Type to be used to check method signatures.

private final SignatureVisitor
signatureVisitor

The visitor to which this adapter must delegate calls.

private CheckSignatureAdapter.State
state

The current state of the automaton used to check the order of method calls.

private final int
type

The type of the visited signature.

public static final int
TYPE_SIGNATURE

Type to be used to check type signatures.See CheckSignatureAdapter(int, SignatureVisitor).

private static final EnumSet<CheckSignatureAdapter.State>
VISIT_CLASS_BOUND_STATES

The valid automaton states for a visitClassBound method call.

private static final EnumSet<CheckSignatureAdapter.State>
VISIT_EXCEPTION_TYPE_STATES

The valid automaton states for a visitExceptionType method call.

private static final EnumSet<CheckSignatureAdapter.State>
VISIT_FORMAL_TYPE_PARAMETER_STATES

The valid automaton states for a visitFormalTypeParameter method call.

private static final EnumSet<CheckSignatureAdapter.State>
VISIT_INTERFACE_BOUND_STATES

The valid automaton states for a visitInterfaceBound method call.

private static final EnumSet<CheckSignatureAdapter.State>
VISIT_INTERFACE_STATES

The valid automaton states for a visitInterface method call.

private static final EnumSet<CheckSignatureAdapter.State>
VISIT_PARAMETER_TYPE_STATES

The valid automaton states for a visitParameterType method call.

private static final EnumSet<CheckSignatureAdapter.State>
VISIT_RETURN_TYPE_STATES

The valid automaton states for a visitReturnType method call.

private static final EnumSet<CheckSignatureAdapter.State>
VISIT_SUPER_CLASS_STATES

The valid automaton states for a visitSuperclass method call.

Inherited from org.objectweb.asm.signature.SignatureVisitor:
apiEXTENDSINSTANCEOFSUPER

Constructor Summary

AccessConstructor and Description
public
CheckSignatureAdapter(final int
the type of signature to be checked. See CLASS_SIGNATURE, METHOD_SIGNATURE and TYPE_SIGNATURE.
type
,
final SignatureVisitor
the visitor to which this adapter must delegate calls. May be null.
signatureVisitor
)

Constructs a new CheckSignatureAdapter.

protected
CheckSignatureAdapter(final int
the ASM API version implemented by this visitor. Must be one of the ASMx values in Opcodes.
api
,
final int
the type of signature to be checked. See CLASS_SIGNATURE, METHOD_SIGNATURE and TYPE_SIGNATURE.
type
,
final SignatureVisitor
the visitor to which this adapter must delegate calls. May be null.
signatureVisitor
)

Constructs a new CheckSignatureAdapter.

Method Summary

Modifier and TypeMethod and Description
private void
checkClassName(final String name, final String message)

private void
checkIdentifier(final String name, final String message)

public SignatureVisitor
visitArrayType()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitArrayType.

Visits a signature corresponding to an array type.
public void
visitBaseType(final char
the descriptor of the primitive type, or 'V' for void .
descriptor
)

Overrides org.objectweb.asm.signature.SignatureVisitor.visitBaseType.

Visits a signature corresponding to a primitive type.
public SignatureVisitor
visitClassBound()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitClassBound.

Visits the class bound of the last visited formal type parameter.
public void
visitClassType(final String
the internal name of the class or interface (see org.objectweb.asm.Type#getInternalName()).
name
)

Overrides org.objectweb.asm.signature.SignatureVisitor.visitClassType.

Starts the visit of a signature corresponding to a class or interface type.
public void
visitEnd()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitEnd.

Ends the visit of a signature corresponding to a class or interface type.
public SignatureVisitor
public void
visitFormalTypeParameter(final String
the name of the formal parameter.
name
)

Overrides org.objectweb.asm.signature.SignatureVisitor.visitFormalTypeParameter.

Visits a formal type parameter.
public void
visitInnerClassType(final String
the local name of the inner class in its enclosing class.
name
)

Overrides org.objectweb.asm.signature.SignatureVisitor.visitInnerClassType.

Visits an inner class.
public SignatureVisitor
visitInterface()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitInterface.

Visits the type of an interface implemented by the class.
public SignatureVisitor
visitInterfaceBound()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitInterfaceBound.

Visits an interface bound of the last visited formal type parameter.
public SignatureVisitor
public SignatureVisitor
visitReturnType()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitReturnType.

Visits the return type of the method.
public SignatureVisitor
visitSuperclass()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitSuperclass.

Visits the type of the super class.
public void
visitTypeArgument()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitTypeArgument.

Visits an unbounded type argument of the last visited class or inner class type.
public SignatureVisitor
visitTypeArgument(final char
'+', '-' or '='.
wildcard
)

Overrides org.objectweb.asm.signature.SignatureVisitor.visitTypeArgument.

Visits a type argument of the last visited class or inner class type.
public void
visitTypeVariable(final String
the name of the type variable.
name
)

Overrides org.objectweb.asm.signature.SignatureVisitor.visitTypeVariable.

Visits a signature corresponding to a type variable.

Field Detail

canBeVoidback to summary
private boolean canBeVoid

Whether the visited signature can be 'V'.

CLASS_SIGNATUREback to summary
public static final int CLASS_SIGNATURE

Type to be used to check class signatures. See CheckSignatureAdapter(int, SignatureVisitor).

INVALIDback to summary
private static final String INVALID
METHOD_SIGNATUREback to summary
public static final int METHOD_SIGNATURE

Type to be used to check method signatures. See CheckSignatureAdapter(int, SignatureVisitor).

signatureVisitorback to summary
private final SignatureVisitor signatureVisitor

The visitor to which this adapter must delegate calls. May be null.

stateback to summary
private CheckSignatureAdapter.State state

The current state of the automaton used to check the order of method calls.

typeback to summary
private final int type

The type of the visited signature.

TYPE_SIGNATUREback to summary
public static final int TYPE_SIGNATURE

Type to be used to check type signatures.See CheckSignatureAdapter(int, SignatureVisitor).

VISIT_CLASS_BOUND_STATESback to summary
private static final EnumSet<CheckSignatureAdapter.State> VISIT_CLASS_BOUND_STATES

The valid automaton states for a visitClassBound method call.

VISIT_EXCEPTION_TYPE_STATESback to summary
private static final EnumSet<CheckSignatureAdapter.State> VISIT_EXCEPTION_TYPE_STATES

The valid automaton states for a visitExceptionType method call.

VISIT_FORMAL_TYPE_PARAMETER_STATESback to summary
private static final EnumSet<CheckSignatureAdapter.State> VISIT_FORMAL_TYPE_PARAMETER_STATES

The valid automaton states for a visitFormalTypeParameter method call.

VISIT_INTERFACE_BOUND_STATESback to summary
private static final EnumSet<CheckSignatureAdapter.State> VISIT_INTERFACE_BOUND_STATES

The valid automaton states for a visitInterfaceBound method call.

VISIT_INTERFACE_STATESback to summary
private static final EnumSet<CheckSignatureAdapter.State> VISIT_INTERFACE_STATES

The valid automaton states for a visitInterface method call.

VISIT_PARAMETER_TYPE_STATESback to summary
private static final EnumSet<CheckSignatureAdapter.State> VISIT_PARAMETER_TYPE_STATES

The valid automaton states for a visitParameterType method call.

VISIT_RETURN_TYPE_STATESback to summary
private static final EnumSet<CheckSignatureAdapter.State> VISIT_RETURN_TYPE_STATES

The valid automaton states for a visitReturnType method call.

VISIT_SUPER_CLASS_STATESback to summary
private static final EnumSet<CheckSignatureAdapter.State> VISIT_SUPER_CLASS_STATES

The valid automaton states for a visitSuperclass method call.

Constructor Detail

CheckSignatureAdapterback to summary
public CheckSignatureAdapter(final int type, final SignatureVisitor signatureVisitor)

Constructs a new CheckSignatureAdapter. Subclasses must not use this constructor. Instead, they must use the CheckSignatureAdapter(int, int, SignatureVisitor) version.

Parameters
type:int

the type of signature to be checked. See CLASS_SIGNATURE, METHOD_SIGNATURE and TYPE_SIGNATURE.

signatureVisitor:SignatureVisitor

the visitor to which this adapter must delegate calls. May be null.

CheckSignatureAdapterback to summary
protected CheckSignatureAdapter(final int api, final int type, final SignatureVisitor signatureVisitor)

Constructs a new CheckSignatureAdapter.

Parameters
api:int

the ASM API version implemented by this visitor. Must be one of the ASMx values in Opcodes.

type:int

the type of signature to be checked. See CLASS_SIGNATURE, METHOD_SIGNATURE and TYPE_SIGNATURE.

signatureVisitor:SignatureVisitor

the visitor to which this adapter must delegate calls. May be null.

Method Detail

checkClassNameback to summary
private void checkClassName(final String name, final String message)
checkIdentifierback to summary
private void checkIdentifier(final String name, final String message)
visitArrayTypeback to summary
public SignatureVisitor visitArrayType()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitArrayType.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitArrayType.

Visits a signature corresponding to an array type.

Returns:SignatureVisitor

a non null visitor to visit the signature of the array element type.

Annotations
@Override
visitBaseTypeback to summary
public void visitBaseType(final char descriptor)

Overrides org.objectweb.asm.signature.SignatureVisitor.visitBaseType.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitBaseType.

Visits a signature corresponding to a primitive type.

Parameters
descriptor:char

the descriptor of the primitive type, or 'V' for void .

Annotations
@Override
visitClassBoundback to summary
public SignatureVisitor visitClassBound()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitClassBound.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitClassBound.

Visits the class bound of the last visited formal type parameter.

Returns:SignatureVisitor

a non null visitor to visit the signature of the class bound.

Annotations
@Override
visitClassTypeback to summary
public void visitClassType(final String name)

Overrides org.objectweb.asm.signature.SignatureVisitor.visitClassType.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitClassType.

Starts the visit of a signature corresponding to a class or interface type.

Parameters
name:String

the internal name of the class or interface (see org.objectweb.asm.Type#getInternalName()).

Annotations
@Override
visitEndback to summary
public void visitEnd()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitEnd.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitEnd.

Ends the visit of a signature corresponding to a class or interface type.

Annotations
@Override
visitExceptionTypeback to summary
public SignatureVisitor visitExceptionType()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitExceptionType.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitExceptionType.

Visits the type of a method exception.

Returns:SignatureVisitor

a non null visitor to visit the signature of the exception type.

Annotations
@Override
visitFormalTypeParameterback to summary
public void visitFormalTypeParameter(final String name)

Overrides org.objectweb.asm.signature.SignatureVisitor.visitFormalTypeParameter.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitFormalTypeParameter.

Visits a formal type parameter.

Parameters
name:String

the name of the formal parameter.

Annotations
@Override
visitInnerClassTypeback to summary
public void visitInnerClassType(final String name)

Overrides org.objectweb.asm.signature.SignatureVisitor.visitInnerClassType.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitInnerClassType.

Visits an inner class.

Parameters
name:String

the local name of the inner class in its enclosing class.

Annotations
@Override
visitInterfaceback to summary
public SignatureVisitor visitInterface()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitInterface.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitInterface.

Visits the type of an interface implemented by the class.

Returns:SignatureVisitor

a non null visitor to visit the signature of the interface type.

Annotations
@Override
visitInterfaceBoundback to summary
public SignatureVisitor visitInterfaceBound()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitInterfaceBound.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitInterfaceBound.

Visits an interface bound of the last visited formal type parameter.

Returns:SignatureVisitor

a non null visitor to visit the signature of the interface bound.

Annotations
@Override
visitParameterTypeback to summary
public SignatureVisitor visitParameterType()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitParameterType.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitParameterType.

Visits the type of a method parameter.

Returns:SignatureVisitor

a non null visitor to visit the signature of the parameter type.

Annotations
@Override
visitReturnTypeback to summary
public SignatureVisitor visitReturnType()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitReturnType.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitReturnType.

Visits the return type of the method.

Returns:SignatureVisitor

a non null visitor to visit the signature of the return type.

Annotations
@Override
visitSuperclassback to summary
public SignatureVisitor visitSuperclass()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitSuperclass.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitSuperclass.

Visits the type of the super class.

Returns:SignatureVisitor

a non null visitor to visit the signature of the super class type.

Annotations
@Override
visitTypeArgumentback to summary
public void visitTypeArgument()

Overrides org.objectweb.asm.signature.SignatureVisitor.visitTypeArgument.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitTypeArgument.

Visits an unbounded type argument of the last visited class or inner class type.

Annotations
@Override
visitTypeArgumentback to summary
public SignatureVisitor visitTypeArgument(final char wildcard)

Overrides org.objectweb.asm.signature.SignatureVisitor.visitTypeArgument.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitTypeArgument.

Visits a type argument of the last visited class or inner class type.

Parameters
wildcard:char

'+', '-' or '='.

Returns:SignatureVisitor

a non null visitor to visit the signature of the type argument.

Annotations
@Override
visitTypeVariableback to summary
public void visitTypeVariable(final String name)

Overrides org.objectweb.asm.signature.SignatureVisitor.visitTypeVariable.

Doc from org.objectweb.asm.signature.SignatureVisitor.visitTypeVariable.

Visits a signature corresponding to a type variable.

Parameters
name:String

the name of the type variable.

Annotations
@Override
org.objectweb.asm.util back to summary

private final Enum CheckSignatureAdapter.State

extends Enum<CheckSignatureAdapter.State>
Class Inheritance

The possible states of the automaton used to check the order of method calls.

Field Summary

Modifier and TypeField and Description
public static final CheckSignatureAdapter.State
public static final CheckSignatureAdapter.State
public static final CheckSignatureAdapter.State
public static final CheckSignatureAdapter.State
public static final CheckSignatureAdapter.State
public static final CheckSignatureAdapter.State
public static final CheckSignatureAdapter.State
public static final CheckSignatureAdapter.State
public static final CheckSignatureAdapter.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static CheckSignatureAdapter.State
public static CheckSignatureAdapter.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BOUNDback to summary
public static final CheckSignatureAdapter.State BOUND
CLASS_TYPEback to summary
public static final CheckSignatureAdapter.State CLASS_TYPE
EMPTYback to summary
public static final CheckSignatureAdapter.State EMPTY
ENDback to summary
public static final CheckSignatureAdapter.State END
FORMALback to summary
public static final CheckSignatureAdapter.State FORMAL
PARAMback to summary
public static final CheckSignatureAdapter.State PARAM
RETURNback to summary
public static final CheckSignatureAdapter.State RETURN
SIMPLE_TYPEback to summary
public static final CheckSignatureAdapter.State SIMPLE_TYPE
SUPERback to summary
public static final CheckSignatureAdapter.State SUPER

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static CheckSignatureAdapter.State valueOf(String name)
valuesback to summary
public static CheckSignatureAdapter.State[] values()