public class ClassStringParser extends StringParser
StringParser for parsing Class objects. The parse(arg) method calls
Class.forName(arg) and returns
the result. If any exceptions are thrown by Class.forName(), they are
encapsulated in a ParseException
and re-thrown.
Note: The Class.forName() call attempts to load the class from the same ClassLoader that loaded this StringParser.
StringParser,
Class| Constructor and Description |
|---|
ClassStringParser()
Deprecated.
Use
getParser() or, even better, JSAP.CLASS_PARSER. |
| Modifier and Type | Method and Description |
|---|---|
static ClassStringParser |
getParser()
Returns a
ClassStringParser. |
Object |
parse(String arg)
Parses the specified argument into a Class object.
|
setUp, tearDownpublic ClassStringParser()
getParser() or, even better, JSAP.CLASS_PARSER.public static ClassStringParser getParser()
ClassStringParser.
Convenient access to the only instance returned by
this method is available through
JSAP.CLASS_PARSER.
ClassStringParser.public Object parse(String arg) throws ParseException
parse in class StringParserarg - the argument to parseParseException - if Class.forName(arg) throws an
exception.Class,
StringParser.parse(String)Copyright © 2016. All rights reserved.