public final class TraceSignatureVisitor extends SignatureVisitor
SignatureVisitor that builds the Java generic type declaration corresponding to the
signature it visits.| Modifier and Type | Field 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 java.lang.String |
COMMA_SEPARATOR |
private java.lang.StringBuilder |
declaration
The Java generic type declaration corresponding to the visited signature.
|
private java.lang.StringBuilder |
exceptions
The Java generic exception types declaration corresponding to the visited signature.
|
private static java.lang.String |
EXTENDS_SEPARATOR |
private boolean |
formalTypeParameterVisited
Whether
visitFormalTypeParameter(java.lang.String) has been called. |
private static java.lang.String |
IMPLEMENTS_SEPARATOR |
private boolean |
interfaceBoundVisited
Whether
visitInterfaceBound() has been called. |
private boolean |
interfaceVisited
Whether
visitInterface() has been called. |
private boolean |
isInterface
Whether the visited signature is a class signature of a Java interface.
|
private boolean |
parameterTypeVisited
Whether
visitParameterType() has been called. |
private java.lang.StringBuilder |
returnType
The Java generic method return type declaration corresponding to the visited signature.
|
private java.lang.String |
separator
The separator to append before the next visited class or inner class type.
|
api, EXTENDS, INSTANCEOF, SUPER| Modifier | Constructor and Description |
|---|---|
|
TraceSignatureVisitor(int accessFlags)
Constructs a new
TraceSignatureVisitor. |
private |
TraceSignatureVisitor(java.lang.StringBuilder stringBuilder) |
| Modifier and Type | Method and Description |
|---|---|
private void |
endFormals() |
private void |
endType() |
java.lang.String |
getDeclaration() |
java.lang.String |
getExceptions() |
java.lang.String |
getReturnType() |
private void |
startType() |
SignatureVisitor |
visitArrayType()
Visits a signature corresponding to an array type.
|
void |
visitBaseType(char descriptor)
Visits a signature corresponding to a primitive type.
|
SignatureVisitor |
visitClassBound()
Visits the class bound of the last visited formal type parameter.
|
void |
visitClassType(java.lang.String name)
Starts the visit of a signature corresponding to a class or interface type.
|
void |
visitEnd()
Ends the visit of a signature corresponding to a class or interface type.
|
SignatureVisitor |
visitExceptionType()
Visits the type of a method exception.
|
void |
visitFormalTypeParameter(java.lang.String name)
Visits a formal type parameter.
|
void |
visitInnerClassType(java.lang.String name)
Visits an inner class.
|
SignatureVisitor |
visitInterface()
Visits the type of an interface implemented by the class.
|
SignatureVisitor |
visitInterfaceBound()
Visits an interface bound of the last visited formal type parameter.
|
SignatureVisitor |
visitParameterType()
Visits the type of a method parameter.
|
SignatureVisitor |
visitReturnType()
Visits the return type of the method.
|
SignatureVisitor |
visitSuperclass()
Visits the type of the super class.
|
void |
visitTypeArgument()
Visits an unbounded type argument of the last visited class or inner class type.
|
SignatureVisitor |
visitTypeArgument(char tag)
Visits a type argument of the last visited class or inner class type.
|
void |
visitTypeVariable(java.lang.String name)
Visits a signature corresponding to a type variable.
|
private static final java.lang.String COMMA_SEPARATOR
private static final java.lang.String EXTENDS_SEPARATOR
private static final java.lang.String IMPLEMENTS_SEPARATOR
private final boolean isInterface
private final java.lang.StringBuilder declaration
private java.lang.StringBuilder returnType
private java.lang.StringBuilder exceptions
private boolean formalTypeParameterVisited
visitFormalTypeParameter(java.lang.String) has been called.private boolean interfaceBoundVisited
visitInterfaceBound() has been called.private boolean parameterTypeVisited
visitParameterType() has been called.private boolean interfaceVisited
visitInterface() has been called.private int argumentStack
private int arrayStack
private java.lang.String separator
public TraceSignatureVisitor(int accessFlags)
TraceSignatureVisitor.accessFlags - for class type signatures, the access flags of the class.private TraceSignatureVisitor(java.lang.StringBuilder stringBuilder)
public void visitFormalTypeParameter(java.lang.String name)
SignatureVisitorvisitFormalTypeParameter in class SignatureVisitorname - the name of the formal parameter.public SignatureVisitor visitClassBound()
SignatureVisitorvisitClassBound in class SignatureVisitorpublic SignatureVisitor visitInterfaceBound()
SignatureVisitorvisitInterfaceBound in class SignatureVisitorpublic SignatureVisitor visitSuperclass()
SignatureVisitorvisitSuperclass in class SignatureVisitorpublic SignatureVisitor visitInterface()
SignatureVisitorvisitInterface in class SignatureVisitorpublic SignatureVisitor visitParameterType()
SignatureVisitorvisitParameterType in class SignatureVisitorpublic SignatureVisitor visitReturnType()
SignatureVisitorvisitReturnType in class SignatureVisitorpublic SignatureVisitor visitExceptionType()
SignatureVisitorvisitExceptionType in class SignatureVisitorpublic void visitBaseType(char descriptor)
SignatureVisitorvisitBaseType in class SignatureVisitordescriptor - the descriptor of the primitive type, or 'V' for void .public void visitTypeVariable(java.lang.String name)
SignatureVisitorvisitTypeVariable in class SignatureVisitorname - the name of the type variable.public SignatureVisitor visitArrayType()
SignatureVisitorvisitArrayType in class SignatureVisitorpublic void visitClassType(java.lang.String name)
SignatureVisitorvisitClassType in class SignatureVisitorname - the internal name of the class or interface.public void visitInnerClassType(java.lang.String name)
SignatureVisitorvisitInnerClassType in class SignatureVisitorname - the local name of the inner class in its enclosing class.public void visitTypeArgument()
SignatureVisitorvisitTypeArgument in class SignatureVisitorpublic SignatureVisitor visitTypeArgument(char tag)
SignatureVisitorvisitTypeArgument in class SignatureVisitortag - '+', '-' or '='.public void visitEnd()
SignatureVisitorvisitEnd in class SignatureVisitorpublic java.lang.String getDeclaration()
public java.lang.String getReturnType()
public java.lang.String getExceptions()
private void endFormals()
private void startType()
private void endType()