Interface Parser<T>
-
public interface Parser<T>
A Parser provides methods to translate a String to a T. This is intended to support the inverse of toString() on ASN.1 types. SeeParserFactory
for how to create a Parser for a particular type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Class<T>
getClazz()
Gets the Class of values parsed by this parser.T
parse(String str)
Translates the text of a String to an object of type T.Parsed<T>
parse(String str, int pos)
Translates part of the text of a String to an object of type T.
-
-
-
Method Detail
-
parse
T parse(String str)
Translates the text of a String to an object of type T. The text should be in the same format as produced by toString(). Checks that there's nothing else in the string but whitespace.- Parameters:
str
- the text to be parsed- Returns:
- the parsed object
-
parse
Parsed<T> parse(String str, int pos)
Translates part of the text of a String to an object of type T. The text should be in the same format as produced by toString().- Parameters:
str
- the text to be parsedpos
- position in str at which to start parsing- Returns:
- the parsed object and position in str at which to resume any further parsing
-
-