public abstract class

AbstractInteractiveUnit

extends AbstractUnit
implements IInteractiveUnit
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.events.JebEventSource
     ↳ com.pnfsoftware.jeb.core.units.AbstractUnit
       ↳ com.pnfsoftware.jeb.core.units.AbstractInteractiveUnit

Class Overview

Skeleton of an interactive 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 unit constructor:

 public DerivedClass(String name, IUnitProcessor unitProcessor, IUnitCreator parent,
         IPropertyDefinitionManager pdm) {
     super(..., name, unitProcessor, parent, pdm);
     ...
 }
 

Summary

[Expand]
Inherited Fields
From class com.pnfsoftware.jeb.core.events.JebEventSource
Public Constructors
AbstractInteractiveUnit(String formatType, String name, IUnit parent)
AbstractInteractiveUnit(String formatType, String name, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm)
Public Methods
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 an empty list.
String getAddressOfItem(long id)
The skeleton implementation returns null.
List<Integer> getGlobalActions()
The skeleton implementation returns an empty list.
List<Integer> getItemActions(long id)
The skeleton implementation returns an empty list.
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.
List<Long> 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.
[Expand]
Inherited Methods
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.IUserDataSupport
From interface com.pnfsoftware.jeb.core.units.IAddressableUnit
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 AbstractInteractiveUnit (String formatType, String name, IUnit parent)

public AbstractInteractiveUnit (String formatType, String name, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm)

Public Methods

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 an empty list.

Parameters
address the target address
Returns
  • the list of actions

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 List<Integer> getGlobalActions ()

The skeleton implementation returns an empty list.

Returns
  • the list of actions

public List<Integer> getItemActions (long id)

The skeleton implementation returns an empty list.

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 List<Long> getRelatedItems (long id)

The skeleton implementation returns an empty list.

Parameters
id an item id
Returns
  • a list of related items (not containing the provided id), may be empty - never null

public boolean isValidAddress (String address)

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

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