com.pnfsoftware.jeb.core.units.IUnit |
Known Indirect Subclasses |
Base interface for units
.
Units parse input data (bytes or product of other units), and produce data and documents to be displayed by a client. Units may also produce and contain children. Children may be persisted (default) or transient. Top-level units (ie, those that are children of an artifact) are always persisted.
Implementors should extend one of the abstract classes that partially implement IUnit and derived
interfaces, such as AbstractUnit
. Specialized units, such as binary code parsers, have
highly-specialized interfaces that clients take advantage of to display extra information and/or
offer features specific to such units.
Implementation guidelines (non-exhaustive):
J.UnitXxx
event.Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
addChild(IUnit unit, boolean persisted)
Add a child unit to this unit.
| ||||||||||
abstract void |
addChild(IUnit unit)
Register a child unit to this unit.
| ||||||||||
abstract void |
addChildUnit(IUnit unit)
Deprecated.
| ||||||||||
abstract boolean |
canBePersisted()
Determine if this unit can be persisted.
| ||||||||||
abstract void |
dispose()
Dispose of the resources used by this unit.
| ||||||||||
abstract IQuickStateObject |
generateQuickState()
Save the state of this unit (it may be a partial state).
| ||||||||||
abstract List<? extends IUnit> |
getChildren()
Retrieve a read-only list of all direct children units.
| ||||||||||
abstract List<IUnitContribution> |
getContributions()
Get the list of contributions attached to the unit.
| ||||||||||
abstract long |
getCreationTimestamp()
Get the date of creation of this unit.
| ||||||||||
abstract String |
getDescription()
Get a description string for that unit.
| ||||||||||
abstract Collection<IInput> |
getExtraInputs()
Get additional inputs.
| ||||||||||
abstract String |
getFormatType()
Mandatory unit type.
| ||||||||||
abstract IUnitFormatter |
getFormatter()
Retrieve a fresh formatter for that unit.
| ||||||||||
abstract byte[] |
getIconData()
The icon bytes representing units of such type.
| ||||||||||
abstract IInput |
getInput()
Get the primary input data for that unit, if there is some.
| ||||||||||
abstract List<IUnitInterpreter> |
getInterpreters()
Get the list of command interpreters attached to the unit.
| ||||||||||
abstract IUnitLock |
getLock()
Get the unit lock.
| ||||||||||
abstract String |
getName()
Get the unit name.
| ||||||||||
abstract String |
getNotes()
Get user-defined notes.
| ||||||||||
abstract IUnitNotificationManager |
getNotificationManager()
Get a reference to the notification manager.
| ||||||||||
abstract IUnitCreator |
getParent()
Retrieve the creator (or parent) of this unit.
| ||||||||||
abstract IArtifact |
getParentArtifact()
Retrieve the artifact from which this unit derive.
| ||||||||||
abstract IRuntimeProject |
getParentProject()
Retrieve the parent
project that owns this unit. | ||||||||||
abstract IPropertyDefinitionManager |
getPropertyDefinitionManager()
Retrieve the PDM used by this unit.
| ||||||||||
abstract IPropertyManager |
getPropertyManager()
Retrieve the PM used by this unit.
| ||||||||||
abstract String |
getRealName()
Retrieve the optional real unit name.
| ||||||||||
abstract String |
getStatus()
Get the status for the unit.
| ||||||||||
abstract long |
getUid()
Retrieve an identifier that uniquely identifies the unit within its
project . | ||||||||||
abstract IUnitProcessor |
getUnitProcessor()
Retrieve the unit processor used by this unit.
| ||||||||||
abstract void |
initializePropertyObjects(IUnitCreator parent, IUnitProcessor processor, IPropertyDefinitionManager pdm)
Initialize the property manager and property definition manager used by this unit.
| ||||||||||
abstract boolean |
isDisposed()
Indicate if the unit has been disposed
| ||||||||||
abstract boolean |
isProcessed()
Verify if the unit was successfully processed.
| ||||||||||
abstract boolean |
isStale()
Determine whether the unit was successfully processed, but is now considered to be stale
(outdated content).
| ||||||||||
abstract boolean |
isTransientChild(IUnit unit)
Check if a child unit is transient.
| ||||||||||
abstract void |
notifyGenericChange()
Notify all listeners of a
generic change , i.e. | ||||||||||
abstract void |
postDeserialization(IRuntimeProject prj)
This method is called by the engines after a unit has been fully deserialized.
| ||||||||||
abstract boolean |
process()
Process the unit.
| ||||||||||
abstract void |
removeChild(IUnit unit)
Remove a direct child of the current unit.
| ||||||||||
abstract void |
setName(String name)
Set the unit name.
| ||||||||||
abstract void |
setNotes(String notes)
Set user-defined notes.
| ||||||||||
abstract void |
setParent(IUnitCreator parent)
Set the parent unit or artifact.
| ||||||||||
abstract void |
setRealName(String name)
Set the optional unit's real name.
| ||||||||||
abstract void |
setUnitProcessor(IUnitProcessor processor)
Set the unit processor.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.pnfsoftware.jeb.core.IUnitCreator
| |||||||||||
From interface
com.pnfsoftware.jeb.core.IUserDataSupport
| |||||||||||
From interface
com.pnfsoftware.jeb.util.events.IEventSource
|
Add a child unit to this unit. Implementations must check for duplicate and also notify clients by emitting the right event.
unit | the child unit |
---|---|
persisted | true if the unit should be persisted upon project saving |
Register a child unit to this unit. The child unit is persisted. Same as
addChild(child, true)
.
unit | the child unit |
---|
Deprecated. Please use addChild(IUnit)
instead.
unit | the child unit |
---|
Determine if this unit can be persisted. This method can be used by parent units and client code to verify if a child unit can legally be persisted.
Dispose of the resources used by this unit.
Save the state of this unit (it may be a partial state). Implementation of this method is optional.
Retrieve a read-only list of all direct children units.
Get the list of contributions attached to the unit.
Get the date of creation of this unit.
Get a description string for that unit.
The unit must be processed before calling this method.
Get additional inputs.
Mandatory unit type. The type should be unique across all units. It should be the same as the
identifier
's type
.
Retrieve a fresh formatter for that unit. Formatters are used to produce document outputs, that represent the unit in whole or in part.
The unit must be processed before calling this method.
The icon bytes representing units of such type. Typically, the data represents a 16x16 BMP or PNG image. Clients may use this data to represent labels for such units in a graphical way.
Get the primary input data for that unit, if there is some. Usually, for top-level units, it
will be the input of the parent artifact
.
Get the list of command interpreters attached to the unit.
Get the unit name.
Get user-defined notes. The notes can be textual data of any sort.
Get a reference to the notification manager.
Retrieve the parent project
that owns this unit.
Retrieve the PDM used by this unit. For consistency, it is recommend that all units of a given type return equivalent PDMs.
Retrieve the PM used by this unit.
Retrieve the optional real unit name.
Get the status for the unit. Plugins should set a status if processing failed. Implementors
must notify their listeners by issuing a UnitStatusChanged
event.
Retrieve an identifier that uniquely identifies the unit within its project
.
Retrieve the unit processor used by this unit.
Initialize the property manager and property definition manager used by this unit.
Code that needs access to the unit's property manager right after deserialization can safely do so after execution of this method.
parent | the parent unit or artifact |
---|---|
processor | the processor |
pdm | the property definition manager for units of this type |
Verify if the unit was successfully processed.
Determine whether the unit was successfully processed, but is now considered to be stale
(outdated content). Re-processing
is encouraged but not mandatory.
The result is irrelevant if isProcessed()
is false
.
stale
; this method should return false if
isProcessed()
returns false
Check if a child unit is transient. By default, children units are persisted.
unit | the child unit |
---|
Notify all listeners of a generic change
, i.e. the contents of this unit
was modified, listeners and controllers should refresh the views representing this unit.
This method is called by the engines after a unit has been fully deserialized. Final repairs (eg, retrieving and re-connecting global objects that were not serialized) may be done by this method. The unit's project and engines are now accessible.
prj | the project to which this unit belongs |
---|
Process the unit. Processing almost always involves parsing, eg, for a code disassembler unit, processing could mean disassembling machine code. This method is called by the unit producer, typically, those are:
UnitProcessed
event. If processing succeeded,
subsequent calls to isProcessed()
should return true.
Remove a direct child of the current unit.
unit | the unit removed |
---|
Set the unit name.
name | the unit name |
---|
Set user-defined notes. The notes can be textual data of any sort.
notes | the notes |
---|
Set the parent unit or artifact.
parent | the parent |
---|
Set the optional unit's real name.
Set the unit processor. This method is called by the managing project or (engines) context.
processor | the unit processor |
---|