public interface CommandInterpreter
This interface is not intended to be implemented by clients.
Modifier and Type | Method and Description |
---|---|
Object |
execute(String cmd)
Execute a command line as if it came from the end user
and return the result.
|
String |
nextArgument()
Get the next argument in the input.
|
void |
print(Object o)
Prints an object to the outputstream
|
void |
printBundleResource(Bundle bundle,
String resource)
Prints the given bundle resource if it exists
|
void |
printDictionary(Dictionary<?,?> dic,
String title)
Prints the given dictionary sorted by keys.
|
void |
println()
Prints an empty line to the outputstream
|
void |
println(Object o)
Prints an object to the output medium (appended with newline character).
|
void |
printStackTrace(Throwable t)
Print a stack trace including nested exceptions.
|
String nextArgument()
Object execute(String cmd)
cmd
- The command line to execute.void print(Object o)
o
- the object to be printedvoid println()
void println(Object o)
If running on the target environment the user is prompted with '--more' if more than the configured number of lines have been printed without user prompt. That way the user of the program has control over the scrolling.
For this to work properly you should not embedded "\n" etc. into the string.
o
- the object to be printedvoid printStackTrace(Throwable t)
t
- The offending exceptionvoid printDictionary(Dictionary<?,?> dic, String title)
dic
- the dictionary to printtitle
- the header to print above the key/value pairsCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.