public class TypeTokenParser extends Object
TypeTokens from the output of TypeToken.toString().
Currently requires that no type variables or wildcards appear.| Constructor and Description |
|---|
TypeTokenParser()
Default constructor.
|
TypeTokenParser(ClassLoader loader)
Primary constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String[] args) |
TypeToken<?> |
parse(ParseContext ctx)
Parse a
TypeToken in string form from a ParseContext. |
TypeToken<?> |
parse(String string)
Parse a
TypeToken in string form. |
public TypeTokenParser()
public TypeTokenParser(ClassLoader loader)
loader - class loader to use for loading classes,
or null for the current thread's context loaderpublic TypeToken<?> parse(String string) throws ClassNotFoundException
TypeToken in string form.string - string to parseIllegalArgumentException - if the input is invalidClassNotFoundException - if a named class could not be foundpublic TypeToken<?> parse(ParseContext ctx) throws ClassNotFoundException
TypeToken in string form from a ParseContext.
Since the TypeToken string format is self-delimiting, not all of the input may be consumed.ctx - parse contextIllegalArgumentException - if the input is invalidClassNotFoundException - if a named class could not be foundCopyright © 2017. All rights reserved.