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
FormatterAPI.Is used for creating a paged document. Uses
VolumeProviderto produceVolumeobjects 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 FormatterConfigurationgetConfiguration()Gets the formatter configuration.TransitionBuildergetTransitionBuilder()Gets the transition builder.Iterable<? extends Volume>getVolumes()ContentCollectionnewCollection(String collectionId)Creates a new collection with the supplied identifier.LayoutMasterBuildernewLayoutMaster(String name, LayoutMasterProperties properties)Creates a new LayoutMaster builder.FormatterSequencenewSequence(SequenceProperties p)Start a new Sequence at the current position in the flow.TableOfContentsnewToc(String tocName)Creates a new table of contents with the supplied name.VolumeTemplateBuildernewVolumeTemplate(VolumeTemplateProperties props)Creates a new empty volume template builder.voidsetConfiguration(FormatterConfiguration config)Sets the formatter configuration.voidwrite(PagedMediaWriter writer)Writes the current result to a paged media.
-
-
-
Method Detail
-
getConfiguration
public FormatterConfiguration getConfiguration()
Description copied from interface:FormatterGets the formatter configuration.- Specified by:
getConfigurationin interfaceFormatter- Returns:
- returns the formatter configuration
-
setConfiguration
public void setConfiguration(FormatterConfiguration config)
Description copied from interface:FormatterSets the formatter configuration.- Specified by:
setConfigurationin interfaceFormatter- Parameters:
config- the configuration
-
newSequence
public FormatterSequence newSequence(SequenceProperties p)
Description copied from interface:FormatterStart a new Sequence at the current position in the flow.- Specified by:
newSequencein 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:FormatterCreates a new LayoutMaster builder.- Specified by:
newLayoutMasterin 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:FormatterCreates a new empty volume template builder.- Specified by:
newVolumeTemplatein interfaceFormatter- Parameters:
props- properties- Returns:
- returns a new volume template builder
-
newToc
public TableOfContents newToc(String tocName)
Description copied from interface:FormatterCreates a new table of contents with the supplied name.
-
newCollection
public ContentCollection newCollection(String collectionId)
Description copied from interface:FormatterCreates a new collection with the supplied identifier.- Specified by:
newCollectionin interfaceFormatter- Parameters:
collectionId- the collection identifier- Returns:
- returns a new collection
-
write
public void write(PagedMediaWriter writer)
Description copied from interface:FormatterWrites the current result to a paged media.
-
getTransitionBuilder
public TransitionBuilder getTransitionBuilder()
Description copied from interface:FormatterGets the transition builder.
- Specified by:
getTransitionBuilderin interfaceFormatter- Returns:
- returns the transition builder
-
-