T
- Command typepublic class ParseResult<T> extends Object
Constructor and Description |
---|
ParseResult(ParseState<T> state,
Collection<ParseException> errors) |
Modifier and Type | Method and Description |
---|---|
T |
getCommand()
Gets the command if one was successfully parsed
|
Collection<ParseException> |
getErrors()
Gets the collection of errors that occurred, may be empty if parsing was
successful
|
ParseState<T> |
getState()
Gets the final parser state
|
boolean |
wasSuccessful()
Indicates whether parsing was successful
|
public ParseResult(ParseState<T> state, Collection<ParseException> errors)
public boolean wasSuccessful()
public ParseState<T> getState()
public Collection<ParseException> getErrors()
public T getCommand()
Note that a command may have been parsed even when errors have been
detected and handled by the error handler. Therefore you should check
wasSuccessful()
and act accordingly before assuming that it is
safe to run the parsed command.
null
if no command was parsedCopyright © 2012–2017. All rights reserved.