public class

SignatureParser

extends Object
java.lang.Object
   ↳ sun.reflect.generics.parser.SignatureParser

Class Overview

Parser for type signatures, as defined in the Java Virtual // Machine Specification (JVMS) chapter 4. Converts the signatures into an abstract syntax tree (AST) representation. // See the package sun.reflect.generics.tree for details of the AST.

Summary

Public Methods
static SignatureParser make()
Static factory method.
ClassSignature parseClassSig(String s)
Parses a class signature (as defined in the JVMS, chapter 4) and produces an abstract syntax tree representing it.
MethodTypeSignature parseMethodSig(String s)
Parses a method signature (as defined in the JVMS, chapter 4) and produces an abstract syntax tree representing it.
TypeSignature parseTypeSig(String s)
Parses a type signature and produces an abstract syntax tree representing it.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static SignatureParser make ()

Static factory method. Produces a parser instance.

Returns
  • an instance of SignatureParser

public ClassSignature parseClassSig (String s)

Parses a class signature (as defined in the JVMS, chapter 4) and produces an abstract syntax tree representing it.

Parameters
s a string representing the input class signature
Returns
  • An abstract syntax tree for a class signature corresponding to the input string
Throws
GenericSignatureFormatError if the input is not a valid class signature

public MethodTypeSignature parseMethodSig (String s)

Parses a method signature (as defined in the JVMS, chapter 4) and produces an abstract syntax tree representing it.

Parameters
s a string representing the input method signature
Returns
  • An abstract syntax tree for a method signature corresponding to the input string
Throws
GenericSignatureFormatError if the input is not a valid method signature

public TypeSignature parseTypeSig (String s)

Parses a type signature and produces an abstract syntax tree representing it.

Parameters
s a string representing the input type signature
Returns
  • An abstract syntax tree for a type signature corresponding to the input string
Throws
GenericSignatureFormatError if the input is not a valid type signature