Package io.permazen.cli.parse.util
Class TypeTokenParser
java.lang.Object
io.permazen.cli.parse.util.TypeTokenParser
Recreates
TypeToken
s from the output of TypeToken.toString()
.
Currently requires that no type variables or wildcards appear.- See Also:
-
Constructor Summary
ConstructorDescriptionDefault constructor.TypeTokenParser
(ClassLoader loader) Primary constructor. -
Method Summary
-
Constructor Details
-
TypeTokenParser
public TypeTokenParser()Default constructor. -
TypeTokenParser
Primary constructor.- Parameters:
loader
- class loader to use for loading classes, or null for theApplicationClassLoader
-
-
Method Details
-
parse
Parse aTypeToken
in string form.- Parameters:
string
- string to parse- Returns:
- parsed type
- Throws:
IllegalArgumentException
- if the input is invalidClassNotFoundException
- if a named class could not be found
-
parse
Parse aTypeToken
in string form from aParseContext
. Since theTypeToken
string format is self-delimiting, not all of the input may be consumed.- Parameters:
ctx
- parse context- Returns:
- parsed type
- Throws:
IllegalArgumentException
- if the input is invalidClassNotFoundException
- if a named class could not be found
-
main
- Throws:
Exception
-