# Class: com.pnfsoftware.jeb.util.interpreter.AbstractCommandHandler

Skeleton for a command handler.

## Constructor: AbstractCommandHandler
- parameter: `parent`, type: `com.pnfsoftware.jeb.util.interpreter.ICommandManager`
- parameter: `name`, type: `java.lang.String`

Description: Create a command handler with no help text.
parameter: parent: parent command manager
parameter: name: command name

## Constructor: AbstractCommandHandler
- parameter: `parent`, type: `com.pnfsoftware.jeb.util.interpreter.ICommandManager`
- parameter: `name`, type: `java.lang.String`
- parameter: `help`, type: `java.lang.String`

Description: Create a command handler.
parameter: parent: parent command manager
parameter: name: command name
parameter: help: short help text

## Constructor: AbstractCommandHandler
- parameter: `parent`, type: `com.pnfsoftware.jeb.util.interpreter.ICommandManager`
- parameter: `name`, type: `java.lang.String`
- parameter: `paramNames`, type: `java.lang.String[]`
- parameter: `help`, type: `java.lang.String`
- parameter: `helpDetails`, type: `java.lang.String`

Description: Create a command handler with named mandatory parameters.
parameter: parent: parent command manager
parameter: name: command name
parameter: paramNames: parameter names
parameter: help: short help text
parameter: helpDetails: extended help text

## Constructor: AbstractCommandHandler
- parameter: `parent`, type: `com.pnfsoftware.jeb.util.interpreter.ICommandManager`
- parameter: `name`, type: `java.lang.String`
- parameter: `params`, type: `com.pnfsoftware.jeb.util.interpreter.CommandParameter[]`
- parameter: `help`, type: `java.lang.String`
- parameter: `helpDetails`, type: `java.lang.String`

Description: Create a command handler with explicit parameter descriptors.
parameter: parent: parent command manager
parameter: name: command name
parameter: params: command parameter descriptors
parameter: help: short help text
parameter: helpDetails: extended help text

## Protected Field: help
Type: `java.lang.String`
Description: Short help text.

## Protected Field: helpDetails
Type: `java.lang.String`
Description: Extended help text.

## Protected Field: name
Type: `java.lang.String`
Description: Command name.

## Protected Field: params
Type: `java.util.List<com.pnfsoftware.jeb.util.interpreter.CommandParameter>`
Description: Command parameter descriptors.

## Protected Field: parent
Type: `com.pnfsoftware.jeb.util.interpreter.ICommandManager`
Description: Parent command manager.

## Method: addParameter
- parameter: `paramName`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.util.interpreter.AbstractCommandHandler`

Description: Add a mandatory parameter by name.
parameter: paramName: parameter name
return: this handler

## Method: addParameter
- parameter: `parameter`, type: `com.pnfsoftware.jeb.util.interpreter.CommandParameter`
- return type: `com.pnfsoftware.jeb.util.interpreter.AbstractCommandHandler`

Description: Add a parameter descriptor.
parameter: parameter: parameter descriptor
return: this handler

## Method: getChildren
- return type: `java.util.List<com.pnfsoftware.jeb.util.interpreter.ICommandNode>`


## Method: getHelp
- return type: `java.lang.String`


## Method: getHelpDetails
- return type: `java.lang.String`


## Method: getName
- return type: `java.lang.String`


## Method: getOptions
- return type: `int`


## Method: getParameterIndex
- parameter: `paramName`, type: `java.lang.String`
- parameter: `prefix`, type: `java.lang.String`
- return type: `int`

Description: Get the index of a command parameter.
parameter: paramName: parameter name
parameter: prefix: parameter prefix
return: the parameter index, or \-1 if none matches

## Method: getParameters
- return type: `java.util.List<com.pnfsoftware.jeb.util.interpreter.CommandParameter>`


## Method: getParent
- return type: `com.pnfsoftware.jeb.util.interpreter.ICommandManager`


## Method: parseInputToken
- parameter: `tokens`, type: `java.util.List<com.pnfsoftware.jeb.util.interpreter.InputToken>`
- return type: `com.pnfsoftware.jeb.util.interpreter.InputToken[]`

Description: Parse input tokens and validate mandatory parameters.
parameter: tokens: input tokens to parse
return: tokens mapped to this handler's parameter list

## Method: parseInputToken
- parameter: `tokens`, type: `java.util.List<com.pnfsoftware.jeb.util.interpreter.InputToken>`
- parameter: `failOnErrors`, type: `boolean`
- return type: `com.pnfsoftware.jeb.util.interpreter.InputToken[]`

Description: Assign input token values at the same indexes as the internal [CommandParameter](CommandParameter) list. The result array can be larger than the parameter list if the last parameter allows multiple tokens.
parameter: tokens: input tokens to parse
parameter: failOnErrors: set to false if you allow missing parameter after a prefixed parameter            \(used for autocompletion\) or missing mandatory parameters
return: tokens mapped to this handler's parameter list

## Protected Method: setHelp
- parameter: `help`, type: `java.lang.String`

Description: Set the short help text.
parameter: help: short help text

## Protected Method: setName
- parameter: `name`, type: `java.lang.String`

Description: Set the command name.
parameter: name: command name

## Method: setOptions
- parameter: `options`, type: `int`
- return type: `com.pnfsoftware.jeb.util.interpreter.AbstractCommandHandler`

Description: Set parser and execution options for this handler.
parameter: options: option bit flags
return: this handler

## Method: toString
- return type: `java.lang.String`


## Static Method: getParameter
- parameter: `tokens`, type: `java.util.List<com.pnfsoftware.jeb.util.interpreter.InputToken>`
- parameter: `i`, type: `int`
- return type: `java.lang.String`

Description: Get a parameter.
parameter: tokens: input tokens
parameter: i: token index
return: the parameter, null on error

## Static Method: getParameterSafe
- parameter: `tokens`, type: `java.util.List<com.pnfsoftware.jeb.util.interpreter.InputToken>`
- parameter: `i`, type: `int`
- return type: `java.lang.String`

Description: Get a parameter, never return null.
parameter: tokens: input tokens
parameter: i: token index
return: the parameter, or the empty string on error

## Static Method: getToken
- parameter: `tokens`, type: `java.util.List<com.pnfsoftware.jeb.util.interpreter.InputToken>`
- parameter: `i`, type: `int`
- return type: `com.pnfsoftware.jeb.util.interpreter.InputToken`

Description: Get an input token by index.
parameter: tokens: input tokens
parameter: i: token index
return: the token, or null if the index is invalid

