public class

ContainerUnit

extends AbstractUnit
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.events.JebEventSource
     ↳ com.pnfsoftware.jeb.core.units.AbstractUnit
       ↳ com.pnfsoftware.jeb.core.units.impl.ContainerUnit
Known Direct Subclasses

Class Overview

Container units are non-binary units used to represent tree structures.

Children can be attached to container units; it is recommended that clients handle container units as if they were file system folders (eg, displaying children should take priority over displaying container unit details).

Summary

Fields
public static final Comparator<IUnit> CONTAINERS_FIRST
[Expand]
Inherited Fields
From class com.pnfsoftware.jeb.core.events.JebEventSource
Public Constructors
ContainerUnit(String formatType, String name, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm)
Create a container unit.
ContainerUnit(String name, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm)
Create a container unit of the "composite" format type.
Public Methods
boolean equals(Object o)
List<? extends IUnit> getChildren()
Sub-classes overriding this method must override related methods consistently.
ContainerUnit getRootContainer()
Get the top-level container unit, within a hierarchy of containers.
int hashCode()
boolean process(boolean processLeaves)
boolean process()
The default implementation calls processInternal(), and makes sure that a status string is set on error, or nullified on success.
[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.IUnit
From interface com.pnfsoftware.jeb.util.events.IEventSource

Fields

public static final Comparator<IUnit> CONTAINERS_FIRST

Public Constructors

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

Create a container unit.

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

Create a container unit of the "composite" format type.

Public Methods

public boolean equals (Object o)

public List<? extends IUnit> getChildren ()

Sub-classes overriding this method must override related methods consistently.

Returns
  • the children or an empty list, never null

public ContainerUnit getRootContainer ()

Get the top-level container unit, within a hierarchy of containers.

Returns
  • the first non-container parent

public int hashCode ()

public boolean process (boolean processLeaves)

public boolean process ()

The default implementation calls processInternal(), and makes sure that a status string is set on error, or nullified on success. processInternal() is never called is isProcessed() returns true.

Plugins may decide to override this method, if they need finer control over processing (we recommend overriding processInternal(); in that case, processInternal() should be ignored.

Returns
  • true if processing is or was successful (in the latter case, process() should do nothing but return true), or false is processing failed. The unit should also notify clients by issuing a UnitProcessed event. If processing succeeded, subsequent calls to isProcessed() should return true.