Package org.daisy.dotify.formatter.impl
Class FormatterImpl
- java.lang.Object
-
- org.daisy.dotify.formatter.impl.FormatterImpl
-
- All Implemented Interfaces:
Formatter
public class FormatterImpl extends Object implements Formatter
Provides an implementation of the
Formatter
API.Is used for creating a paged document. Uses
VolumeProvider
to produceVolume
objects from a list ofBlockSequence
, which are provided throughnewSequence(SequenceProperties)
, and populated through methods likeFormatterCoreImpl.startBlock(BlockProperties)
,FormatterCoreImpl.addChars(CharSequence, TextProperties)
, etc. The resuling paged document is collected through aPagedMediaWriter
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormatterConfiguration
getConfiguration()
Gets the formatter configuration.TransitionBuilder
getTransitionBuilder()
Gets the transition builder.Iterable<? extends Volume>
getVolumes()
ContentCollection
newCollection(String collectionId)
Creates a new collection with the supplied identifier.LayoutMasterBuilder
newLayoutMaster(String name, LayoutMasterProperties properties)
Creates a new LayoutMaster builder.FormatterSequence
newSequence(SequenceProperties p)
Start a new Sequence at the current position in the flow.TableOfContents
newToc(String tocName)
Creates a new table of contents with the supplied name.VolumeTemplateBuilder
newVolumeTemplate(VolumeTemplateProperties props)
Creates a new empty volume template builder.void
setConfiguration(FormatterConfiguration config)
Sets the formatter configuration.void
write(PagedMediaWriter writer)
Writes the current result to a paged media.
-
-
-
Method Detail
-
getConfiguration
public FormatterConfiguration getConfiguration()
Description copied from interface:Formatter
Gets the formatter configuration.- Specified by:
getConfiguration
in interfaceFormatter
- Returns:
- returns the formatter configuration
-
setConfiguration
public void setConfiguration(FormatterConfiguration config)
Description copied from interface:Formatter
Sets the formatter configuration.- Specified by:
setConfiguration
in interfaceFormatter
- Parameters:
config
- the configuration
-
newSequence
public FormatterSequence newSequence(SequenceProperties p)
Description copied from interface:Formatter
Start a new Sequence at the current position in the flow.- Specified by:
newSequence
in interfaceFormatter
- Parameters:
p
- the SequenceProperties for the new sequence- Returns:
- returns a formatter core
-
newLayoutMaster
public LayoutMasterBuilder newLayoutMaster(String name, LayoutMasterProperties properties)
Description copied from interface:Formatter
Creates a new LayoutMaster builder.- Specified by:
newLayoutMaster
in interfaceFormatter
- Parameters:
name
- The name of the LayoutMaster. This is the named used in when retrieving a master for a particular sequence from theSequenceProperties
.properties
- the properties- Returns:
- a layout master builder
-
newVolumeTemplate
public VolumeTemplateBuilder newVolumeTemplate(VolumeTemplateProperties props)
Description copied from interface:Formatter
Creates a new empty volume template builder.- Specified by:
newVolumeTemplate
in interfaceFormatter
- Parameters:
props
- properties- Returns:
- returns a new volume template builder
-
newToc
public TableOfContents newToc(String tocName)
Description copied from interface:Formatter
Creates a new table of contents with the supplied name.
-
newCollection
public ContentCollection newCollection(String collectionId)
Description copied from interface:Formatter
Creates a new collection with the supplied identifier.- Specified by:
newCollection
in interfaceFormatter
- Parameters:
collectionId
- the collection identifier- Returns:
- returns a new collection
-
write
public void write(PagedMediaWriter writer)
Description copied from interface:Formatter
Writes the current result to a paged media.
-
getTransitionBuilder
public TransitionBuilder getTransitionBuilder()
Description copied from interface:Formatter
Gets the transition builder.
- Specified by:
getTransitionBuilder
in interfaceFormatter
- Returns:
- returns the transition builder
-
-