Class AbstractCommandInterpreter
java.lang.Object
com.pnfsoftware.jeb.util.interpreter.AbstractCommandInterpreter
- All Implemented Interfaces:
ICommandInterpreter
Skeleton for a command interpreter.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionautoComplete
(String command) Provide a best-effort completion suggestion for the provided partial command.Retrieve the interpreter's banner/logo string.Get the long name or description.void
prepare()
Interpreters may place resource intensive preparation operations here.boolean
Determine whether this interpreter prefers that the results ofexecuted commands
be printed as-is.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.pnfsoftware.jeb.util.interpreter.ICommandInterpreter
executeCommand, getName
-
Constructor Details
-
AbstractCommandInterpreter
public AbstractCommandInterpreter()
-
-
Method Details
-
getDescription
Description copied from interface:ICommandInterpreter
Get the long name or description.- Specified by:
getDescription
in interfaceICommandInterpreter
- Returns:
- optional string
-
getBanner
Description copied from interface:ICommandInterpreter
Retrieve the interpreter's banner/logo string.- Specified by:
getBanner
in interfaceICommandInterpreter
- Returns:
- optional string that client code (shells) may display when the interpreter was just instantiated
-
prepare
public void prepare()Description copied from interface:ICommandInterpreter
Interpreters may place resource intensive preparation operations here. Clients may optionally call this method before invoking either:ICommandInterpreter.executeCommand(String)
orICommandInterpreter.autoComplete(String)
. Clients may decide to not call thsi method. An interpreter implementation must handle cases where prepare() is never called, sometimes called, called multiple times, etc.- Specified by:
prepare
in interfaceICommandInterpreter
-
shouldDisplayRawResults
public boolean shouldDisplayRawResults()Description copied from interface:ICommandInterpreter
Determine whether this interpreter prefers that the results ofexecuted commands
be printed as-is. Clients decide whether or not they want to follow this guideline.- Specified by:
shouldDisplayRawResults
in interfaceICommandInterpreter
- Returns:
-
autoComplete
Description copied from interface:ICommandInterpreter
Provide a best-effort completion suggestion for the provided partial command.- Specified by:
autoComplete
in interfaceICommandInterpreter
- Returns:
- optional auto-completion result object
-