public final class GenericSignatureParser extends Object
ClassSignature ::=
OptFormalTypeParams SuperclassSignature {SuperinterfaceSignature}.
SuperclassSignature ::= ClassTypeSignature.
SuperinterfaceSignature ::= ClassTypeSignature.
OptFormalTypeParams ::=
["<" FormalTypeParameter {FormalTypeParameter} ">"].
FormalTypeParameter ::= Ident ClassBound {InterfaceBound}.
ClassBound ::= ":" [FieldTypeSignature].
InterfaceBound ::= ":" FieldTypeSignature.
FieldTypeSignature ::=
ClassTypeSignature | ArrayTypeSignature | TypeVariableSignature.
ArrayTypeSignature ::= "[" TypSignature.
ClassTypeSignature ::=
"L" {Ident "/"} Ident OptTypeArguments {"." Ident OptTypeArguments} ";".
OptTypeArguments ::= "<" TypeArgument {TypeArgument} ">".
TypeArgument ::= ([WildcardIndicator] FieldTypeSignature) | "*".
WildcardIndicator ::= "+" | "-".
TypeVariableSignature ::= "T" Ident ";".
TypSignature ::= FieldTypeSignature | BaseType.
BaseType ::= "B" | "C" | "D" | "F" | "I" | "J" | "S" | "Z".
MethodTypeSignature ::=
OptFormalTypeParams "(" {TypeSignature} ")" ReturnType {ThrowsSignature}.
ThrowsSignature ::= ("^" ClassTypeSignature) | ("^" TypeVariableSignature).
ReturnType ::= TypSignature | VoidDescriptor.
VoidDescriptor ::= "V".
| Modifier and Type | Field and Description |
|---|---|
ListOfTypes |
exceptionTypes |
Type |
fieldType |
TypeVariable[] |
formalTypeParameters |
ListOfTypes |
interfaceTypes |
ClassLoader |
loader |
ListOfTypes |
parameterTypes |
Type |
returnType |
Type |
superclassType |
| Constructor and Description |
|---|
GenericSignatureParser(ClassLoader loader) |
| Modifier and Type | Method and Description |
|---|---|
void |
parseForClass(GenericDeclaration genericDecl,
String signature)
Parses the generic signature of a class and creates the data structure
representing the signature.
|
void |
parseForConstructor(GenericDeclaration genericDecl,
String signature,
Class<?>[] rawExceptionTypes)
Parses the generic signature of a constructor and creates the data
structure representing the signature.
|
void |
parseForField(GenericDeclaration genericDecl,
String signature)
Parses the generic signature of a field and creates the data structure
representing the signature.
|
void |
parseForMethod(GenericDeclaration genericDecl,
String signature,
Class<?>[] rawExceptionTypes)
Parses the generic signature of a method and creates the data structure
representing the signature.
|
public ListOfTypes exceptionTypes
public ListOfTypes parameterTypes
public TypeVariable[] formalTypeParameters
public Type returnType
public Type fieldType
public ListOfTypes interfaceTypes
public Type superclassType
public ClassLoader loader
public GenericSignatureParser(ClassLoader loader)
public void parseForClass(GenericDeclaration genericDecl, String signature)
genericDecl - the GenericDeclaration calling this methodsignature - the generic signature of the classpublic void parseForMethod(GenericDeclaration genericDecl, String signature, Class<?>[] rawExceptionTypes)
genericDecl - the GenericDeclaration calling this methodsignature - the generic signature of the classpublic void parseForConstructor(GenericDeclaration genericDecl, String signature, Class<?>[] rawExceptionTypes)
genericDecl - the GenericDeclaration calling this methodsignature - the generic signature of the classpublic void parseForField(GenericDeclaration genericDecl, String signature)
genericDecl - the GenericDeclaration calling this methodsignature - the generic signature of the class