org.apache.qpid.tools.utils
Class SimpleCommandParser
java.lang.Object
org.apache.qpid.tools.utils.SimpleCommandParser
- All Implemented Interfaces:
- CommandParser
public class SimpleCommandParser
- extends Object
- implements CommandParser
Method Summary |
boolean |
isBackground()
True if the currently parsed command has been requested as a background operation |
boolean |
more()
If there is more than one command received on the last parse request. |
String[] |
parse()
Parses user commands, and groups tokens in the
String[] format that all Java main's love. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_reader
protected BufferedReader _reader
- Input source of commands
SimpleCommandParser
public SimpleCommandParser(BufferedReader reader)
more
public boolean more()
- Description copied from interface:
CommandParser
- If there is more than one command received on the last parse request.
Subsequent calls to parse will utilise this input rather than reading new data from the input source
- Specified by:
more
in interface CommandParser
- Returns:
- boolean
isBackground
public boolean isBackground()
- Description copied from interface:
CommandParser
- True if the currently parsed command has been requested as a background operation
- Specified by:
isBackground
in interface CommandParser
- Returns:
- boolean
parse
public String[] parse()
throws IOException
- Description copied from interface:
CommandParser
- Parses user commands, and groups tokens in the
String[] format that all Java main's love.
If more than one command is provided in one input line then the more() method will return true.
A subsequent call to parse() will continue to parse that input line before reading new input.
- Specified by:
parse
in interface CommandParser
- Returns:
input
split in args[] format; null if eof.
- Throws:
IOException
- if there is a problem reading from the input stream
Licensed to the Apache Software Foundation