public abstract class

AbstractInteractiveBinaryUnit

extends AbstractBinaryUnit
implements IInteractiveUnit
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
Known Direct Subclasses

Class Overview

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);
     ...
 }
 

Summary

Public Constructors
AbstractInteractiveBinaryUnit(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.
Public Methods
IInputLocation addressToLocation(String address)
The skeleton implementation returns null.
boolean canExecuteAction(ActionContext actionContext)
The skeleton implementation returns false.
boolean executeAction(ActionContext actionContext, IActionData actionData, boolean notify)
The skeleton implementation returns false.
boolean executeAction(ActionContext actionContext, IActionData actionData)
The skeleton implementation returns executeAction(actionContext, actionData, true).
List<Integer> getAddressActions(String address)
The skeleton implementation returns null.
String getAddressLabel(String address)
The skeleton implementation returns null.
Map<String, String> getAddressLabels()
The skeleton implementation returns null.
String getAddressOfItem(long id)
The skeleton implementation returns null.
String getComment(String address)
The skeleton implementation returns null.
Map<String, String> getComments()
The skeleton implementation returns null.
List<Integer> getGlobalActions()
The skeleton implementation returns null.
List<Integer> getItemActions(long id)
The skeleton implementation returns null.
long getItemAtAddress(String address)
The skeleton implementation returns 0.
Object getItemObject(long id)
The skeleton implementation returns null.
IMetadataManager getMetadataManager()
The skeleton implementation returns an empty metadata manager.
boolean isValidAddress(String address)
The default implementation returns true IFF the address can be converted to a valid (non-zero) item id.
String locationToAddress(IInputLocation location)
The skeleton implementation returns null.
boolean prepareExecution(ActionContext actionContext, IActionData actionData)
The skeleton implementation returns false.
[Expand]
Inherited Methods
From class com.pnfsoftware.jeb.core.units.AbstractBinaryUnit
From class com.pnfsoftware.jeb.core.units.AbstractUnit
From class com.pnfsoftware.jeb.core.events.JebEventSource
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.IUnitCreator
From interface com.pnfsoftware.jeb.core.units.IAddressableUnit
From interface com.pnfsoftware.jeb.core.units.IBinaryUnit
From interface com.pnfsoftware.jeb.core.units.IInteractiveUnit
From interface com.pnfsoftware.jeb.core.units.IUnit
From interface com.pnfsoftware.jeb.util.events.IEventSource

Public Constructors

public AbstractInteractiveBinaryUnit (String mimeType, IInput input, String formatType, String name, IUnit parent)

public AbstractInteractiveBinaryUnit (String mimeType, IInput input, String formatType, String name, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm)

Constructor.

Public Methods

public IInputLocation addressToLocation (String address)

The skeleton implementation returns null.

Parameters
address mandatory address
Returns
  • the location, null if none, error, or not supported

public boolean canExecuteAction (ActionContext actionContext)

The skeleton implementation returns false.

Parameters
actionContext location context for the action
Returns
  • true

public boolean executeAction (ActionContext actionContext, IActionData actionData, boolean notify)

The skeleton implementation returns false.

Parameters
actionContext context for the action
actionData data for the action
notify true to notify clients if the action was successfully executed and the unit contents has changed
Returns
  • action success indicator

public boolean executeAction (ActionContext actionContext, IActionData actionData)

The skeleton implementation returns executeAction(actionContext, actionData, true).

Parameters
actionContext location context for the action
actionData data for the action
Returns
  • true if the execution was successful. Upon successful execution, actionData will contain plugin-set post-execution data

public List<Integer> getAddressActions (String address)

The skeleton implementation returns null.

Parameters
address the target address
Returns
  • the list of actions

public String getAddressLabel (String address)

The skeleton implementation returns null.

Parameters
address mandatory address
Returns
  • the label, null if none

public Map<String, String> getAddressLabels ()

The skeleton implementation returns null.

Returns
  • a map of "address: label" value pairs

public String getAddressOfItem (long id)

The skeleton implementation returns null.

Parameters
id the item id
Returns
  • an address best representing or matching the provided item, null otherwise

public String getComment (String address)

The skeleton implementation returns null.

Parameters
address mandatory address
Returns
  • the comment, null if none

public Map<String, String> getComments ()

The skeleton implementation returns null.

Returns
  • a map of "address: comment" value pairs

public List<Integer> getGlobalActions ()

The skeleton implementation returns null.

Returns
  • the list of actions

public List<Integer> getItemActions (long id)

The skeleton implementation returns null.

Parameters
id the target item identifier
Returns
  • the list of actions

public long getItemAtAddress (String address)

The skeleton implementation returns 0.

Parameters
address the address
Returns
  • an item best representing or matching the provided address, 0 otherwise

public Object getItemObject (long id)

The skeleton implementation returns null.

Parameters
id the item id
Returns
  • an object, whose type is defined by contract, potentially null

public IMetadataManager getMetadataManager ()

The skeleton implementation returns an empty metadata manager.

Returns
  • the manager, null if none

public boolean isValidAddress (String address)

The default implementation returns true IFF the address can be converted to a valid (non-zero) item id.

public String locationToAddress (IInputLocation location)

The skeleton implementation returns null.

Parameters
location mandatory location
Returns
  • the address, null if none, error, or not supported

public boolean prepareExecution (ActionContext actionContext, IActionData actionData)

The skeleton implementation returns false.

Parameters
actionContext location context for the action
actionData 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