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

public final Class TraceSignatureVisitor

extends SignatureVisitor
Class Inheritance
Imports
java.util.Collections, .HashMap, .Map, org.objectweb.asm.Opcodes, org.objectweb.asm.signature.SignatureVisitor

A SignatureVisitor that builds the Java generic type declaration corresponding to the signature it visits.
Authors
Eugene Kuleshov, Eric Bruneton

Field Summary

Modifier and TypeField and Description
private int
argumentStack

The stack used to keep track of class types that have arguments.

private int
arrayStack

The stack used to keep track of array class types.

private static final Map<Character, String>
private static final String
private final StringBuilder
declaration

The Java generic type declaration corresponding to the visited signature.

private StringBuilder
exceptions

The Java generic exception types declaration corresponding to the visited signature.

private static final String
private boolean
private static final String
private boolean
private boolean
interfaceVisited

Whether visitInterface has been called.

private final boolean
isInterface

Whether the visited signature is a class signature of a Java interface.

private boolean
parameterTypeVisited

Whether visitParameterType has been called.

private StringBuilder
returnType

The Java generic method return type declaration corresponding to the visited signature.

private String
separator

The separator to append before the next visited class or inner class type.

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

Constructor Summary

AccessConstructor and Description
public
TraceSignatureVisitor(final int
for class type signatures, the access flags of the class.
accessFlags
)

Constructs a new TraceSignatureVisitor.

private
TraceSignatureVisitor(final StringBuilder stringBuilder)

Method Summary

Modifier and TypeMethod and Description
private void
private void
public String

Returns:

the Java generic type declaration corresponding to the visited signature.
getDeclaration
()

Returns the Java generic type declaration corresponding to the visited signature.

public String

Returns:

the Java generic exception types declaration corresponding to the visited signature.
getExceptions
()

Returns the Java generic exception types declaration corresponding to the visited signature.

public String

Returns:

the Java generic method return type declaration corresponding to the visited signature.
getReturnType
()

Returns the Java generic method return type declaration corresponding to the visited signature.

private void
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 '='.
tag
)

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

argumentStackback to summary
private int argumentStack

The stack used to keep track of class types that have arguments. Each element of this stack is a boolean encoded in one bit. The top of the stack is the least significant bit. Pushing false = *2, pushing true = *2+1, popping = /2.

arrayStackback to summary
private int arrayStack

The stack used to keep track of array class types. Each element of this stack is a boolean encoded in one bit. The top of the stack is the lowest order bit. Pushing false = *2, pushing true = *2+1, popping = /2.

BASE_TYPESback to summary
private static final Map<Character, String> BASE_TYPES
COMMA_SEPARATORback to summary
private static final String COMMA_SEPARATOR
declarationback to summary
private final StringBuilder declaration

The Java generic type declaration corresponding to the visited signature.

exceptionsback to summary
private StringBuilder exceptions

The Java generic exception types declaration corresponding to the visited signature.

EXTENDS_SEPARATORback to summary
private static final String EXTENDS_SEPARATOR
formalTypeParameterVisitedback to summary
private boolean formalTypeParameterVisited

Whether visitFormalTypeParameter has been called.

IMPLEMENTS_SEPARATORback to summary
private static final String IMPLEMENTS_SEPARATOR
interfaceBoundVisitedback to summary
private boolean interfaceBoundVisited

Whether visitInterfaceBound has been called.

interfaceVisitedback to summary
private boolean interfaceVisited

Whether visitInterface has been called.

isInterfaceback to summary
private final boolean isInterface

Whether the visited signature is a class signature of a Java interface.

parameterTypeVisitedback to summary
private boolean parameterTypeVisited

Whether visitParameterType has been called.

returnTypeback to summary
private StringBuilder returnType

The Java generic method return type declaration corresponding to the visited signature.

separatorback to summary
private String separator

The separator to append before the next visited class or inner class type.

Constructor Detail

TraceSignatureVisitorback to summary
public TraceSignatureVisitor(final int accessFlags)

Constructs a new TraceSignatureVisitor.

Parameters
accessFlags:int

for class type signatures, the access flags of the class.

TraceSignatureVisitorback to summary
private TraceSignatureVisitor(final StringBuilder stringBuilder)

Method Detail

endFormalsback to summary
private void endFormals()
endTypeback to summary
private void endType()
getDeclarationback to summary
public String getDeclaration()

Returns the Java generic type declaration corresponding to the visited signature.

Returns:String

the Java generic type declaration corresponding to the visited signature.

getExceptionsback to summary
public String getExceptions()

Returns the Java generic exception types declaration corresponding to the visited signature.

Returns:String

the Java generic exception types declaration corresponding to the visited signature.

getReturnTypeback to summary
public String getReturnType()

Returns the Java generic method return type declaration corresponding to the visited signature.

Returns:String

the Java generic method return type declaration corresponding to the visited signature.

startTypeback to summary
private void startType()
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 tag)

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
tag: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