Package com.pnfsoftware.jeb.core.units
Class AbstractInteractiveBinaryUnit
java.lang.Object
com.pnfsoftware.jeb.core.events.JebEventSource
com.pnfsoftware.jeb.core.units.AbstractUnit
com.pnfsoftware.jeb.core.units.AbstractBinaryUnit
com.pnfsoftware.jeb.core.units.AbstractInteractiveBinaryUnit
- All Implemented Interfaces:
IUnitCreator
,IUserDataSupport
,IAddressableUnit
,IBinaryUnit
,IInteractiveUnit
,IUnit
,IEventSource
- Direct Known Subclasses:
AbstractCodeUnit
@Ser
public abstract class AbstractInteractiveBinaryUnit
extends AbstractBinaryUnit
implements IInteractiveUnit
Skeleton of an interactive binary unit. Usage of this abstract class is encouraged. This unit
provides a default metadata manager.
Implementors must implement their own constructor; the default constructor is used for deserialization only. Example of a typical interactive binary unit constructor:
public DerivedClass(String name, IInput input, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm) { super(..., input, ..., name, unitProcessor, parent, pdm); ... }
-
Field Summary
Fields inherited from class com.pnfsoftware.jeb.core.events.JebEventSource
onEventCallCount
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractInteractiveBinaryUnit
(String mimeType, IInput input, String formatType, String name, IUnit parent) AbstractInteractiveBinaryUnit
(String mimeType, IInput input, String formatType, String name, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canExecuteAction
(ActionContext actionContext) The skeleton implementation returns false.boolean
executeAction
(ActionContext actionContext, IActionData actionData) The skeleton implementation returnsexecuteAction(actionContext, actionData, true)
.boolean
executeAction
(ActionContext actionContext, IActionData actionData, boolean notify) The skeleton implementation returns false.getAddressActions
(String address) The skeleton implementation returns an empty list.getAddressOfItem
(long id) The skeleton implementation returns null.The skeleton implementation returns an empty list.getItemActions
(long id) The skeleton implementation returns an empty list.long
getItemAtAddress
(String address) The skeleton implementation returns 0.getItemObject
(long id) The skeleton implementation returns null.The skeleton implementation returns an empty metadata manager.getRelatedItems
(long id) The skeleton implementation returns an empty list.boolean
isValidAddress
(String address) The default implementation returns true IFF the address can be converted to a valid (non-zero) item id.boolean
prepareExecution
(ActionContext actionContext, IActionData actionData) The skeleton implementation returns false.Methods inherited from class com.pnfsoftware.jeb.core.units.AbstractBinaryUnit
getInput, getMimeType, setInput, setMimeType
Methods inherited from class com.pnfsoftware.jeb.core.units.AbstractUnit
addChild, addChild, addChild, addNotification, canBePersisted, clearAllData, dispose, finalize, generateQuickState, getAllData, getChildren, getContributions, getCreationTimestamp, getData, getDescription, getFormatter, getFormatType, getIconData, getInterpreters, getLock, getName, getNotes, getNotificationManager, getParent, getPropertyDefinitionManager, getPropertyManager, getRealName, getStatus, getUid, getUnitProcessor, hasChildren, initializePropertyObjects, internalSwapChildren, isDeserialized, isDisposed, isProcessed, isStale, isTransientChild, logError, logException, logInfo, logTrace, logWarn, onPropertyChange, postDeserialization, process, processInternal, removeChild, removeChild, setChild, setChild, setData, setName, setNotes, setParent, setProcessed, setProcessed, setRealName, setStatus, setStatus, setUnitProcessor, toString
Methods inherited from class com.pnfsoftware.jeb.core.events.JebEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, notifyListeners, notifyListeners, removeListener, setParentSource
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.pnfsoftware.jeb.core.units.IAddressableUnit
getAddressLabel, getAddressLabels, getCanonicalAddress, getWellKnownAddresses
Methods inherited from interface com.pnfsoftware.jeb.util.events.IEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, removeListener, setParentSource
Methods inherited from interface com.pnfsoftware.jeb.core.units.IInteractiveUnit
addressToLocation, getCommentManager, getFullComment, getFullComments, getInlineComment, getInlineComments, locationToAddress, setInlineComment
Methods inherited from interface com.pnfsoftware.jeb.core.units.IUnit
addChild, addChild, canBePersisted, dispose, generateQuickState, getChildren, getContributions, getCreationTimestamp, getDescription, getExtraInputs, getFormatter, getFormatType, getIconData, getInterpreters, getLock, getName, getNotes, getNotificationManager, getParent, getParentArtifact, getParentProject, getPropertyDefinitionManager, getPropertyManager, getRealName, getStatus, getUid, getUnitProcessor, initializePropertyObjects, isDisposed, isProcessed, isStale, isTransientChild, notifyGenericChange, postDeserialization, process, removeChild, setName, setNotes, setParent, setRealName, setUnitProcessor
Methods inherited from interface com.pnfsoftware.jeb.core.IUserDataSupport
clearAllData, getAllData, getData, setData
-
Constructor Details
-
AbstractInteractiveBinaryUnit
-
AbstractInteractiveBinaryUnit
public AbstractInteractiveBinaryUnit(String mimeType, IInput input, String formatType, String name, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm) Constructor.
-
-
Method Details
-
getItemObject
The skeleton implementation returns null.- Specified by:
getItemObject
in interfaceIAddressableUnit
- Parameters:
id
- the item id- Returns:
- an object, whose type is defined by contract, potentially null
-
getGlobalActions
The skeleton implementation returns an empty list.- Specified by:
getGlobalActions
in interfaceIInteractiveUnit
- Returns:
- the list of actions
-
getItemActions
The skeleton implementation returns an empty list.- Specified by:
getItemActions
in interfaceIInteractiveUnit
- Parameters:
id
- the target item identifier- Returns:
- the list of actions
-
getAddressActions
The skeleton implementation returns an empty list.- Specified by:
getAddressActions
in interfaceIInteractiveUnit
- Parameters:
address
- the target address- Returns:
- the list of actions
- See Also:
-
getAddressOfItem
The skeleton implementation returns null.- Specified by:
getAddressOfItem
in interfaceIAddressableUnit
- Parameters:
id
- the item id- Returns:
- an address best representing or matching the provided item, null otherwise
-
getRelatedItems
The skeleton implementation returns an empty list.- Specified by:
getRelatedItems
in interfaceIAddressableUnit
- Parameters:
id
- an item id- Returns:
- a list of related items (not containing the provided id), may be empty - never null
-
isValidAddress
The default implementation returns true IFF the address can be converted to a valid (non-zero) item id.- Specified by:
isValidAddress
in interfaceIAddressableUnit
- Returns:
-
getItemAtAddress
The skeleton implementation returns 0.- Specified by:
getItemAtAddress
in interfaceIAddressableUnit
- Parameters:
address
- the address- Returns:
- an item best representing or matching the provided address, 0 otherwise
-
canExecuteAction
The skeleton implementation returns false.- Specified by:
canExecuteAction
in interfaceIInteractiveUnit
- Parameters:
actionContext
- location context for the action- Returns:
- true
-
prepareExecution
The skeleton implementation returns false.- Specified by:
prepareExecution
in interfaceIInteractiveUnit
- Parameters:
actionContext
- location context for the actionactionData
- data for the action- Returns:
- true if the preparation was successful, and the action may be executed. Upon successful preparation, actionData will contain plugin-set pre-execution data
-
executeAction
The skeleton implementation returnsexecuteAction(actionContext, actionData, true)
.- Specified by:
executeAction
in interfaceIInteractiveUnit
- Parameters:
actionContext
- location context for the actionactionData
- data for the action- Returns:
- true if the execution was successful. Upon successful execution, actionData will contain plugin-set post-execution data
-
executeAction
The skeleton implementation returns false.- Specified by:
executeAction
in interfaceIInteractiveUnit
- Parameters:
actionContext
- context for the actionactionData
- data for the actionnotify
- true to notify clients if the action was successfully executed and the unit contents has changed- Returns:
- action success indicator
-
getMetadataManager
The skeleton implementation returns an empty metadata manager.- Specified by:
getMetadataManager
in interfaceIInteractiveUnit
- Returns:
- the manager, null if none
-