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.voidprepare()Interpreters may place resource intensive preparation operations here.booleanDetermine whether this interpreter prefers that the results ofexecuted commandsbe printed as-is.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pnfsoftware.jeb.util.interpreter.ICommandInterpreter
executeCommand, getName
-
Constructor Details
-
AbstractCommandInterpreter
public AbstractCommandInterpreter()
-
-
Method Details
-
getDescription
Description copied from interface:ICommandInterpreterGet the long name or description.- Specified by:
getDescriptionin interfaceICommandInterpreter- Returns:
- optional string
-
getBanner
Description copied from interface:ICommandInterpreterRetrieve the interpreter's banner/logo string.- Specified by:
getBannerin interfaceICommandInterpreter- Returns:
- optional string that client code (shells) may display when the interpreter was just instantiated
-
prepare
public void prepare()Description copied from interface:ICommandInterpreterInterpreters 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:
preparein interfaceICommandInterpreter
-
shouldDisplayRawResults
public boolean shouldDisplayRawResults()Description copied from interface:ICommandInterpreterDetermine whether this interpreter prefers that the results ofexecuted commandsbe printed as-is. Clients decide whether or not they want to follow this guideline.- Specified by:
shouldDisplayRawResultsin interfaceICommandInterpreter- Returns:
-
autoComplete
Description copied from interface:ICommandInterpreterProvide a best-effort completion suggestion for the provided partial command.- Specified by:
autoCompletein interfaceICommandInterpreter- Returns:
- optional auto-completion result object
-