public interface ParsingContext
Modifier and Type | Method and Description |
---|---|
void |
advanceLocation(int offset)
Advances the current location by skipping the specified number of characters.
|
void |
enterState(ParsingState state)
Enters the state passed in as the argument which then becomes the current state.
|
ParsingStateCallbackHandler |
getCallbackHandler()
The callback handler used for current parsing.
|
char |
getCharacter()
The character at the current location in the input string.
|
CommandFormatException |
getError()
Returns the exception if there was one during parsing or null
if the line was parsed successfully.
|
String |
getInput()
The complete string being parsed.
|
int |
getLocation()
The current location in the input string.
|
ParsingState |
getState()
The current state.
|
boolean |
isEndOfContent()
Checks whether the end of the input string has been reached.
|
boolean |
isStrict()
Indicates whether handlers should complain by throwing exceptions
in case of issues or be forgiving where possible and there is
a reason to be.
|
ParsingState |
leaveState()
Leaves the current state and and returns it.
|
void |
reenterState()
Leaves the current state and then enters it again.
|
void |
setError(CommandFormatException e)
Sets the error indicating that there was a problem
during parsing.
|
String getInput()
ParsingState getState()
void enterState(ParsingState state) throws CommandFormatException
state
- the state to enterCommandFormatException
- in case something went wrongParsingState leaveState() throws CommandFormatException
CommandFormatException
- in case something went wrongvoid reenterState() throws CommandFormatException
CommandFormatException
- in case something went wrongParsingStateCallbackHandler getCallbackHandler()
char getCharacter()
int getLocation()
boolean isEndOfContent()
void advanceLocation(int offset) throws IndexOutOfBoundsException
offset
- the number of characters to skipIndexOutOfBoundsException
- if the new location exceeds the input string lengthboolean isStrict()
CommandFormatException getError()
void setError(CommandFormatException e)
e
- the errorCopyright © 2013 JBoss by Red Hat. All rights reserved.