public class

SimpleCommandManager

extends Object
implements ICommandManager
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.interpreter.SimpleCommandManager

Class Overview

A basic command manager that may be extended.

Summary

[Expand]
Inherited Constants
From interface com.pnfsoftware.jeb.util.interpreter.ICommandNode
Public Constructors
SimpleCommandManager()
SimpleCommandManager(ICommandManager parent, String name)
Public Methods
ICommandNode addChild(ICommandNode node)
ExecutionResult execute(String line)
ExecutionResult execute(List<InputToken> tokens)
Execute the command.
List<ICommandNode> getChildren()
String getHelp()
Retrieve a short help that describes the command
String getName()
Retrieve the name of the command (used to invoke the command)
int getOptions()
ICommandManager getParent()
Retrieve the parent, that is, this node's manager.
List<InputToken> parseTokenString(String line)
@return
Protected Methods
ExecutionResult postCheck()
Override to do command post-execution check.
ExecutionResult preCheck()
Override to do command pre-execution check.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pnfsoftware.jeb.util.interpreter.ICommandManager
From interface com.pnfsoftware.jeb.util.interpreter.ICommandNode

Public Constructors

public SimpleCommandManager ()

public SimpleCommandManager (ICommandManager parent, String name)

Public Methods

public ICommandNode addChild (ICommandNode node)

public ExecutionResult execute (String line)

public ExecutionResult execute (List<InputToken> tokens)

Execute the command.

public List<ICommandNode> getChildren ()

public String getHelp ()

Retrieve a short help that describes the command

public String getName ()

Retrieve the name of the command (used to invoke the command)

public int getOptions ()

public ICommandManager getParent ()

Retrieve the parent, that is, this node's manager.

public List<InputToken> parseTokenString (String line)

@return

Throws
ParseException

Protected Methods

protected ExecutionResult 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

protected ExecutionResult 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