public class

UnitFormatterAdapter

extends Object
implements IUnitFormatter
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.output.UnitFormatterAdapter

Class Overview

Standard implementation of a unit formatter.

Summary

Public Constructors
UnitFormatterAdapter()
Create a formatter with no document presentation.
UnitFormatterAdapter(IUnitDocumentPresentation presentation)
Create a formatter and add a transient (non-persisted) document presentation to it.
Public Methods
void addDocumentPresentation(IUnitDocumentPresentation presentation)
Add a transient (non-persisted) document presentation to a unit formatter.
void addPresentation(IUnitDocumentPresentation presentation, boolean persisted)
Add a presentation.
void discardTransientPresentations()
Discard all presentations not marked as persisted.
List<IUnitDocumentPresentation> getDocumentPresentations()
This method has been deprecated; Use getPresentations().
IUnitDocumentPresentation getPresentation(int index)
Retrieve a presentation.
int getPresentationCount()
Get the number of document presentations contained in this formatter.
List<IUnitDocumentPresentation> getPresentations()
Retrieve a list of all (persisted and transient) document presentations.
void insertPresentation(int index, IUnitDocumentPresentation presentation, boolean persisted)
Insert a presentation at the given index.
boolean isPersisted(int index)
Determine whether or not a presentation is to be persisted upon serialization.
void removePresentation(int index)
Remove a presentation.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.output.IUnitFormatter

Public Constructors

public UnitFormatterAdapter ()

Create a formatter with no document presentation.

public UnitFormatterAdapter (IUnitDocumentPresentation presentation)

Create a formatter and add a transient (non-persisted) document presentation to it.

Parameters
presentation a document

Public Methods

public void addDocumentPresentation (IUnitDocumentPresentation presentation)

Add a transient (non-persisted) document presentation to a unit formatter. This method is left for compatibility purpose, and will be deprecated in a subsequent release. Please use addPresentation(IUnitDocumentPresentation, boolean) instead.

Parameters
presentation a document

public void addPresentation (IUnitDocumentPresentation presentation, boolean persisted)

Add a presentation. The presentation will be appended to the list of existing presentations. If the presentation already exists in this formatter, this method will silently fail.

Parameters
presentation the presentation
persisted true to persist the presentation, false otherwise; if true, the presentation must be serializable

public void discardTransientPresentations ()

Discard all presentations not marked as persisted.

public List<IUnitDocumentPresentation> getDocumentPresentations ()

This method has been deprecated; Use getPresentations().

Returns
  • a list of document presentations, possibly empty

public IUnitDocumentPresentation getPresentation (int index)

Retrieve a presentation.

Parameters
index presentation index
Returns
  • the presentation or null

public int getPresentationCount ()

Get the number of document presentations contained in this formatter.

Returns
  • the number of presentations

public List<IUnitDocumentPresentation> getPresentations ()

Retrieve a list of all (persisted and transient) document presentations. This list is a copy; any attempt to modify it will raise an exception.

Returns
  • a list of document presentations, possibly empty

public void insertPresentation (int index, IUnitDocumentPresentation presentation, boolean persisted)

Insert a presentation at the given index. If the presentation already exists in this formatter, this method will silently fail.

Parameters
index insertion index
presentation the presentation
persisted true to persist the presentation, false otherwise; if true, the presentation must be serializable

public boolean isPersisted (int index)

Determine whether or not a presentation is to be persisted upon serialization.

Parameters
index presentation index
Returns
  • persistence indicator

public void removePresentation (int index)

Remove a presentation.

Parameters
index presentation index