# Class: com.pnfsoftware.jeb.core.actions.ActionContext

Context of pre\-execution and execution for an [action](Actions). 

 These objects are provided by a client \(front\-end\) to a unit plugin when trying to: 
 
- [verify execution](IInteractiveUnit#canExecuteAction(ActionContext)): the client checks if an action execution can take place
-  
- [prepare for execution](IInteractiveUnit#prepareExecution(ActionContext, IActionData)): the client may provide pre\-execution information, the engine will provide pre\-execution information as well
-  
- [execute an action](IInteractiveUnit#executeAction(ActionContext, IActionData)): the client provides input data required by the plugin to perform the action
-  

 The context identifies the target unit, action identifier, and optionally the selected item or address.

## Constructor: ActionContext
- parameter: `unit`, type: `com.pnfsoftware.jeb.core.units.IInteractiveUnit`
- parameter: `actionId`, type: `int`
- parameter: `itemId`, type: `long`

Description: Create an object, requesting action information for the provided item or provided address.
parameter: unit: mandatory target unit
parameter: actionId: mandatory action id
parameter: itemId: optional item id \(0 for none\)

## Constructor: ActionContext
- parameter: `unit`, type: `com.pnfsoftware.jeb.core.units.IInteractiveUnit`
- parameter: `actionId`, type: `int`
- parameter: `itemId`, type: `long`
- parameter: `address`, type: `java.lang.String`

Description: Create an object, requesting action information for the provided item or provided address.
parameter: unit: mandatory target unit
parameter: actionId: mandatory action id
parameter: itemId: optional item id \(0 for none\)
parameter: address: optional address \(`null` for none\)

## Constructor: ActionContext
- parameter: `unit`, type: `com.pnfsoftware.jeb.core.units.IInteractiveUnit`
- parameter: `actionId`, type: `int`
- parameter: `itemId`, type: `long`
- parameter: `address`, type: `java.lang.String`
- parameter: `precision`, type: `com.pnfsoftware.jeb.core.output.AddressConversionPrecision`

Description: Create an object, requesting action information for the provided item or provided address.
parameter: unit: mandatory target unit
parameter: actionId: mandatory action id
parameter: itemId: optional item id \(0 for none\)
parameter: address: optional address \(`null` for none\)
parameter: precision: precision of the address

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

Description: Get the action identifier.
return: the mandatory action identifier

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

Description: Get the address at which the action should take place.
return: the optional address, null if none

## Method: getAddressPrecision
- return type: `com.pnfsoftware.jeb.core.output.AddressConversionPrecision`

Description: Get the precision associated with the target address.
return: the address precision

## Method: getItemId
- return type: `long`

Description: Get the item id of the object onto which the action should take place.
return: the optional item id, 0 if none

## Method: getUnit
- return type: `com.pnfsoftware.jeb.core.units.IInteractiveUnit`

Description: Get the unit on to which the action is to be executed.
return: the unit

## Method: setActionId
- parameter: `actionId`, type: `int`

Description: Set the action identifier.
parameter: actionId: action identifier

## Method: setAddress
- parameter: `address`, type: `java.lang.String`

Description: Set the target address.
parameter: address: address, or `null` if the action is not address\-based

## Method: setAddressPrecision
- parameter: `addressPrecision`, type: `com.pnfsoftware.jeb.core.output.AddressConversionPrecision`

Description: Set the precision associated with the target address.
parameter: addressPrecision: address precision

## Method: setItemId
- parameter: `itemId`, type: `long`

Description: Set the target item identifier.
parameter: itemId: item identifier, or `0` if no item is selected

## Method: setUnit
- parameter: `unit`, type: `com.pnfsoftware.jeb.core.units.IInteractiveUnit`

Description: Set the target unit.
parameter: unit: target interactive unit

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


