Class SimpleCommandManager
java.lang.Object
com.pnfsoftware.jeb.util.interpreter.SimpleCommandManager
- All Implemented Interfaces:
ICommandManager,ICommandNode
A basic command manager that may be extended.
-
Field Summary
Fields inherited from interface com.pnfsoftware.jeb.util.interpreter.ICommandNode
QUOTES_AS_NORMAL_CHAR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddChild(ICommandNode node) execute(List<InputToken> tokens) Execute the command.getHelp()Retrieve a short help that describes the commandgetName()Retrieve the name of the command (used to invoke the command)intRetrieve the parent, that is, this node's manager.parseTokenString(String line) protected ExecutionResultOverride to do command post-execution check.protected ExecutionResultpreCheck()Override to do command pre-execution check.
-
Constructor Details
-
SimpleCommandManager
public SimpleCommandManager() -
SimpleCommandManager
-
-
Method Details
-
getParent
Description copied from interface:ICommandNodeRetrieve the parent, that is, this node's manager.- Specified by:
getParentin interfaceICommandNode- Returns:
-
getName
Description copied from interface:ICommandNodeRetrieve the name of the command (used to invoke the command)- Specified by:
getNamein interfaceICommandNode- Returns:
-
addChild
- Specified by:
addChildin interfaceICommandManager
-
getChildren
- Specified by:
getChildrenin interfaceICommandNode- Returns:
-
getHelp
Description copied from interface:ICommandNodeRetrieve a short help that describes the command- Specified by:
getHelpin interfaceICommandNode- Returns:
-
execute
-
execute
Description copied from interface:ICommandNodeExecute the command.- Specified by:
executein interfaceICommandNode- Returns:
-
preCheck
Override to do command pre-execution check. The default implementation does nothing.- Returns:
- an error to prevent the command from executing; null or a success to proceed with command execution
-
postCheck
Override to do command post-execution check. Only executed if command execution succeeded. The default implementation does nothing.- Returns:
- an error to prevent the command from executing; null or a success to proceed
-
parseTokenString
- Parameters:
line-- Returns:
- Throws:
ParseException
-
getOptions
public int getOptions()- Specified by:
getOptionsin interfaceICommandNode- Returns:
-