Package org.daisy.dotify.api.formatter
Interface BlockContentBuilder
-
- All Known Subinterfaces:
BlockBuilder
,ContentCollection
,FormatterCore
,FormatterSequence
,TableOfContents
,VolumeContentBuilder
- All Known Implementing Classes:
BlockSequence
,ContentCollectionImpl
,FormatterCoreImpl
,TableOfContentsImpl
public interface BlockContentBuilder
Provides methods that supply content to a block.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addChars(CharSequence chars, TextProperties props)
Add chars to the current block.void
endSpan()
Ends a previously opened span section.void
endStyle()
Ends a previously opened style section.void
insertAnchor(String ref)
Insert an anchor at the current position in the flow.void
insertEvaluate(DynamicContent exp, TextProperties t)
Inserts an expression to evaluate.void
insertExternalReference(Object reference)
Inserts a reference element that could be used to add information required for external systems.void
insertLeader(Leader leader, TextProperties props)
Insert a leader at the current position in the flow.void
insertMarker(Marker marker)
Insert a marker at the current position in the flow.void
insertMarkerReference(Iterable<? extends MarkerReference> ref, TextProperties t)
Inserts a (compound) marker reference.void
insertPageReference(String identifier, NumeralStyle numeralStyle)
Adds the page number of a reference.void
newLine()
Explicitly break the current line, even if the line has space left for more characters.void
startSpan(SpanProperties props)
Starts a span section.void
startStyle(String style)
Starts a style section.
-
-
-
Method Detail
-
insertMarker
void insertMarker(Marker marker)
Insert a marker at the current position in the flow.- Parameters:
marker
- the marker to insert- Throws:
IllegalStateException
- if the current state does not allow this call to be made
-
insertAnchor
void insertAnchor(String ref)
Insert an anchor at the current position in the flow.- Parameters:
ref
- anchor name- Throws:
IllegalStateException
- if the current state does not allow this call to be made
-
insertLeader
void insertLeader(Leader leader, TextProperties props)
Insert a leader at the current position in the flow.- Parameters:
leader
- the leader to insertprops
- the TextProperties including the mode to translate the pattern- Throws:
IllegalStateException
- if the current state does not allow this call to be made
-
addChars
void addChars(CharSequence chars, TextProperties props)
Add chars to the current block.- Parameters:
chars
- the characters to add to the flowprops
- the SpanProperties for the characters- Throws:
IllegalStateException
- if the current state does not allow this call to be made
-
startStyle
void startStyle(String style)
Starts a style section.- Parameters:
style
- the name of the style- Throws:
IllegalStateException
- if the current state does not allow this call to be made
-
endStyle
void endStyle()
Ends a previously opened style section.- Throws:
IllegalStateException
- if the current state does not allow this call to be made
-
startSpan
void startSpan(SpanProperties props)
Starts a span section.- Parameters:
props
- the span properties
-
endSpan
void endSpan()
Ends a previously opened span section.- Throws:
IllegalStateException
- if the current state does not allow this call to be made
-
newLine
void newLine()
Explicitly break the current line, even if the line has space left for more characters. The current block remains open.- Throws:
IllegalStateException
- if the current state does not allow this call to be made
-
insertPageReference
void insertPageReference(String identifier, NumeralStyle numeralStyle)
Adds the page number of a reference.- Parameters:
identifier
- the element of interestnumeralStyle
- the numeral style- Throws:
IllegalStateException
- if the current state does not allow this call to be made
-
insertMarkerReference
void insertMarkerReference(Iterable<? extends MarkerReference> ref, TextProperties t)
Inserts a (compound) marker reference.- Parameters:
ref
- the reference(s)t
- the text properties
-
insertEvaluate
void insertEvaluate(DynamicContent exp, TextProperties t)
Inserts an expression to evaluate.- Parameters:
exp
- the expressiont
- the text properties
-
insertExternalReference
void insertExternalReference(Object reference)
Inserts a reference element that could be used to add information required for external systems.- Parameters:
reference
- Reference data.
-
-