protected static class ProcessIOParser.Parser extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
ProcessIOParser.Parser.Input
State machine input classes.
|
protected static class |
ProcessIOParser.Parser.State
State machine internal states.
|
Modifier and Type | Field and Description |
---|---|
private ProcessIOContent |
content
Content to verify on server administration command execution IO.
|
private StringBuilder |
line
Current line being processed.
|
private LinkedList<String> |
output
Process output log lines.
|
(package private) CyclicStringBuffer |
promptBuff
Cyclic buffer to compare input against prompt.
|
private int |
promptLen
Process input prompt length.
|
private ProcessIOResult |
result
Content verification result.
|
private ProcessIOParser.Parser.State |
state
Machine internal state.
|
private ProcessIOContent.Token |
token
Content token to be verified.
|
Modifier | Constructor and Description |
---|---|
protected |
ProcessIOParser.Parser(ProcessIOContent content)
Creates an instance of process output parser.
|
Modifier and Type | Method and Description |
---|---|
protected ProcessIOParser.Parser.State |
action(char c)
Run parser action based on current state and character class.
|
protected void |
endOfLine(char c)
Handle end of line.
|
protected void |
finish()
Finish parsing when end of file was reached.
|
protected void |
firstChar(char c)
Clear line content and append first character.
|
protected String |
getOutputString()
Build output string from stored process output lines.
|
protected void |
nextChar(char c)
Append next character.
|
protected void |
nextCharWithCR(char c)
Append next character after CR.
|
protected void |
parse(char[] buff,
short len)
Parses content of process output.
|
protected ProcessIOResult |
result()
Get content verification result.
|
private final ProcessIOContent content
private ProcessIOContent.Token token
private ProcessIOResult result
private int promptLen
private final StringBuilder line
CyclicStringBuffer promptBuff
private ProcessIOParser.Parser.State state
private final LinkedList<String> output
protected ProcessIOParser.Parser(ProcessIOContent content)
content
- Content to verify on server administration command
execution IO.protected void parse(char[] buff, short len)
buff
- Buffer with incoming process standard output data.len
- Data length in process standard output buffer.protected void finish()
protected ProcessIOResult result()
protected ProcessIOParser.Parser.State action(char c)
c
- Current character being processed from Reader
buffer.protected void firstChar(char c)
c
- Current character from buffer.protected void nextChar(char c)
c
- Current character from buffer.protected void nextCharWithCR(char c)
c
- Current character from buffer.protected void endOfLine(char c)
c
- Current character from buffer (not used).protected String getOutputString()
Copyright © 2013. All Rights Reserved.