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)int
Retrieve the parent, that is, this node's manager.parseTokenString
(String line) protected ExecutionResult
Override to do command post-execution check.protected ExecutionResult
preCheck()
Override to do command pre-execution check.
-
Constructor Details
-
SimpleCommandManager
public SimpleCommandManager() -
SimpleCommandManager
-
-
Method Details
-
getParent
Description copied from interface:ICommandNode
Retrieve the parent, that is, this node's manager.- Specified by:
getParent
in interfaceICommandNode
- Returns:
-
getName
Description copied from interface:ICommandNode
Retrieve the name of the command (used to invoke the command)- Specified by:
getName
in interfaceICommandNode
- Returns:
-
addChild
- Specified by:
addChild
in interfaceICommandManager
-
getChildren
- Specified by:
getChildren
in interfaceICommandNode
- Returns:
-
getHelp
Description copied from interface:ICommandNode
Retrieve a short help that describes the command- Specified by:
getHelp
in interfaceICommandNode
- Returns:
-
execute
-
execute
Description copied from interface:ICommandNode
Execute the command.- Specified by:
execute
in 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:
getOptions
in interfaceICommandNode
- Returns:
-