Package com.pnfsoftware.jeb.core.actions
Class ActionData
java.lang.Object
com.pnfsoftware.jeb.core.actions.ActionData
- All Implemented Interfaces:
IActionData
- Direct Known Subclasses:
ActionAutoRenameAllData,ActionCollapseData,ActionCommentData,ActionConvertData,ActionCreatePackageData,ActionDeleteData,ActionMoveToData,ActionMoveToPackageData,ActionOverridesData,ActionRenameData,ActionReplaceData,ActionSetTypeData,ActionTypeHierarchyData,ActionXrefsData
Base implementation for action payload objects.
This class provides common support for execution errors, reusable scratch values, and optional descriptive text.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe error code 0 means that no error code was set-up. -
Constructor Summary
ConstructorsConstructorDescriptionCreate an action payload with the default information-request behavior.ActionData(boolean hintNoInfoRequest) Create an action payload. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine whether this action data object may be safely reused after areset()invocation.Retrieve the description string provided by the plugins.intThe client may retrieve the optionally-set execution error code after a failed call toexecuteAction()The client may retrieve the optionally-set execution error message after a failed call toexecuteAction()Retrieve an arbitrary object associated with a key.booleanDetermine whether the client requested a minimal preparation pass.voidreset()Reset this action data object.voidsetDescription(String description) Set the description string to be provided to the clients.voidsetExecutionError(int code, String msg) The plugin may set an execution error code and message on a failedexecuteAction()invocation.voidsetExecutionErrorCode(int code) The plugin may set an execution error code on a failedexecuteAction()invocation.voidThe plugin may set an execution error message on a failedexecuteAction()invocation.voidStore an arbitrary object associated with a key.
-
Field Details
-
ERRCODE_UNKNOWN
public static final int ERRCODE_UNKNOWNThe error code 0 means that no error code was set-up. Meaningful error codes must be non-zero, and are defined within specific action data classes (sub-classes of this class).- See Also:
-
-
Constructor Details
-
ActionData
public ActionData()Create an action payload with the default information-request behavior. -
ActionData
public ActionData(boolean hintNoInfoRequest) Create an action payload.- Parameters:
hintNoInfoRequest- iftrue, hints that only minimal preparation data is needed because the client intends to execute the action regardless of the current state
-
-
Method Details
-
isNoInfoRequest
public boolean isNoInfoRequest()Determine whether the client requested a minimal preparation pass.- Returns:
trueif only minimal action information should be prepared
-
reset
public void reset()Reset this action data object. Sub-classes should override this method and invoke it as well. -
canReuseObject
public boolean canReuseObject()Determine whether this action data object may be safely reused after areset()invocation.- Returns:
trueif the object can be reused after being reset
-
setDescription
Set the description string to be provided to the clients. To be used by plugins.- Parameters:
description- a human-readable description for the action state
-
getDescription
Retrieve the description string provided by the plugins. To be used by clients.- Returns:
- the description string, or
nullif none was provided
-
setExecutionError
The plugin may set an execution error code and message on a failedexecuteAction()invocation.- Parameters:
code- non-zero error codemsg- optional error message
-
setExecutionErrorCode
public void setExecutionErrorCode(int code) The plugin may set an execution error code on a failedexecuteAction()invocation.- Parameters:
code- non-zero error code
-
getExecutionErrorCode
public int getExecutionErrorCode()The client may retrieve the optionally-set execution error code after a failed call toexecuteAction()- Returns:
- the execution error code, or
ERRCODE_UNKNOWNif none was provided
-
setExecutionErrorMessage
The plugin may set an execution error message on a failedexecuteAction()invocation.- Parameters:
msg- optional error message
-
getExecutionErrorMessage
The client may retrieve the optionally-set execution error message after a failed call toexecuteAction()- Returns:
- the execution error message, or
nullif none was provided
-
getValue
Retrieve an arbitrary object associated with a key.- Specified by:
getValuein interfaceIActionData- Parameters:
key- object key- Returns:
- the stored object, or
null
-
setValue
Store an arbitrary object associated with a key.- Specified by:
setValuein interfaceIActionData- Parameters:
key- object keyvalue- object value
-