Package org.apache.maven.doxia.module.fo
Class FoAggregateSink
java.lang.Object
org.apache.maven.doxia.sink.impl.AbstractSink
org.apache.maven.doxia.sink.impl.SinkAdapter
org.apache.maven.doxia.sink.impl.AbstractXmlSink
org.apache.maven.doxia.module.fo.FoSink
org.apache.maven.doxia.module.fo.FoAggregateSink
- All Implemented Interfaces:
org.apache.maven.doxia.logging.LogEnabled
,org.apache.maven.doxia.markup.Markup
,org.apache.maven.doxia.markup.XmlMarkup
,FoMarkup
,org.apache.maven.doxia.sink.Sink
A Doxia Sink that produces an aggregated FO model. The usage is similar to the following:
FoAggregateSink sink = new FoAggregateSink( writer ); sink.setDocumentModel( documentModel ); sink.beginDocument(); sink.coverPage(); sink.toc(); ... sink.endDocument();Note: the documentModel object contains several document metadata, but only a few of them are used in this sink (i.e. author, confidential, date and title), the others are ignored.
- Since:
- 1.1
- Author:
- ltheussl
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Table Of Content at the end of the document.static final int
No Table Of Content.static final int
Table Of Content at the start of the document.Fields inherited from class org.apache.maven.doxia.module.fo.FoSink
inlineStack, warnMessages
Fields inherited from interface org.apache.maven.doxia.module.fo.FoMarkup
BASIC_LINK_TAG, BLOCK_TAG, BOOKMARK_TAG, BOOKMARK_TITLE_TAG, BOOKMARK_TREE_TAG, FLOW_TAG, FO_NAMESPACE, INLINE_TAG, LAYOUT_MASTER_SET_TAG, LEADER_TAG, LIST_BLOCK_TAG, LIST_ITEM_BODY_TAG, LIST_ITEM_LABEL_TAG, LIST_ITEM_TAG, PAGE_NUMBER_CITATION_TAG, PAGE_NUMBER_TAG, PAGE_SEQUENCE_TAG, REGION_AFTER_TAG, REGION_BEFORE_TAG, REGION_BODY_TAG, ROOT_TAG, SIMPLE_PAGE_MASTER_TAG, STATIC_CONTENT_TAG, TABLE_AND_CAPTION_TAG, TABLE_BODY_TAG, TABLE_CAPTION_TAG, TABLE_CELL_TAG, TABLE_COLUMN_TAG, TABLE_ROW_TAG, TABLE_TAG
Fields inherited from interface org.apache.maven.doxia.markup.Markup
COLON, EOL, EQUAL, GREATER_THAN, LEFT_CURLY_BRACKET, LEFT_SQUARE_BRACKET, LESS_THAN, MINUS, PLUS, QUOTE, RIGHT_CURLY_BRACKET, RIGHT_SQUARE_BRACKET, SEMICOLON, SLASH, SPACE, STAR
Fields inherited from interface org.apache.maven.doxia.sink.Sink
JUSTIFY_CENTER, JUSTIFY_LEFT, JUSTIFY_RIGHT, NUMBERING_DECIMAL, NUMBERING_LOWER_ALPHA, NUMBERING_LOWER_ROMAN, NUMBERING_UPPER_ALPHA, NUMBERING_UPPER_ROMAN, ROLE, SECTION_LEVEL_1, SECTION_LEVEL_2, SECTION_LEVEL_3, SECTION_LEVEL_4, SECTION_LEVEL_5, SECTION_LEVEL_6
Fields inherited from interface org.apache.maven.doxia.markup.XmlMarkup
BANG, CDATA, DOCTYPE_START, ENTITY_START, XML_NAMESPACE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
author()
void
author
(org.apache.maven.doxia.sink.SinkEventAttributes attributes) void
author_()
void
body()
void
body
(org.apache.maven.doxia.sink.SinkEventAttributes attributes) void
body_()
protected void
chapterHeading
(String headerText, boolean chapterNumber) Writes a chapter heading.protected void
Writes content, escaping special characters.void
Writes a cover page.void
date()
void
date
(org.apache.maven.doxia.sink.SinkEventAttributes attributes) void
date_()
void
figureGraphics
(String name) void
figureGraphics
(String src, org.apache.maven.doxia.sink.SinkEventAttributes attributes) protected String
Returns the current chapter number as a string.protected String
Returns the text to write in the footer of each page.protected String
Returns the text to write in the header of each page.void
head()
void
head
(org.apache.maven.doxia.sink.SinkEventAttributes attributes) void
head_()
void
void
protected void
newline()
Writes EOL.protected void
Writes a fo:bookmark-tree.protected void
regionAfter
(String footerText) Writes a 'xsl-region-after' block.protected void
regionBefore
(String headerText) Writes a 'xsl-region-before' block.void
setDocumentModel
(org.apache.maven.doxia.document.DocumentModel model) Sets the DocumentModel to be used by this sink.void
setDocumentModel
(org.apache.maven.doxia.document.DocumentModel model, int tocPos) Sets the DocumentModel to be used by this sink.void
setDocumentName
(String name) Sets the name of the current source document, relative to the source root.void
setDocumentTitle
(String title) Sets the title of the current document.protected void
startPageSequence
(String headerText, String footerText) Starts a page sequence, depending on the current chapter.void
title()
void
title
(org.apache.maven.doxia.sink.SinkEventAttributes attributes) void
title_()
void
toc()
Writes a table of contents.protected void
Writes a text, swallowing any exceptions.protected void
writeEmptyTag
(HTML.Tag tag, String attributeId) Writes a simple tag, appending EOL.protected void
protected void
Writes a text, appending EOL.protected void
writeStartTag
(HTML.Tag tag, String attributeId) Writes a start tag, prepending EOL.protected void
writeStartTag
(HTML.Tag tag, String id, String name) Writes a start tag, prepending EOL.Methods inherited from class org.apache.maven.doxia.module.fo.FoSink
anchor_, beginDocument, bold, bold_, close, comment, definedTerm, definedTerm, definedTerm_, definition, definition, definition_, definitionList, definitionList, definitionList_, definitionListItem, definitionListItem, definitionListItem_, endDocument, escaped, figure, figure, figure_, figureCaption, figureCaption, figureCaption_, flush, getFoConfiguration, horizontalRule, horizontalRule, init, inline, inline, inline_, isFigure, italic, italic_, lineBreak, lineBreak, link_, list, list, list_, listItem, listItem, listItem_, load, logMessage, monospaced, monospaced_, nonBreakingSpace, numberedList, numberedList, numberedList_, numberedListItem, numberedListItem, numberedListItem_, pageBreak, paragraph, paragraph, paragraph_, rawText, resetSectionCounter, section, section_, section1, section1_, section2, section2_, section3, section3_, section4, section4_, section5, section5_, sectionTitle, sectionTitle, sectionTitle_, sectionTitle_, sectionTitle1, sectionTitle1_, sectionTitle2, sectionTitle2_, sectionTitle3, sectionTitle3_, sectionTitle4, sectionTitle4_, sectionTitle5, sectionTitle5_, startPageSequence, table, table, table_, tableCaption, tableCaption, tableCaption_, tableCell, tableCell, tableCell, tableCell_, tableHeaderCell, tableHeaderCell, tableHeaderCell, tableHeaderCell_, tableRow, tableRow, tableRow_, tableRows, tableRows_, text, text, unknown, verbatim, verbatim, verbatim_, writeEmptyTag, writeStartTag, writeStartTag
Methods inherited from class org.apache.maven.doxia.sink.impl.AbstractXmlSink
getNameSpace, setInsertNewline, setNameSpace, writeEOL, writeSimpleTag, writeSimpleTag, writeStartTag, writeStartTag
Methods inherited from class org.apache.maven.doxia.sink.impl.SinkAdapter
address, address, address_, article, article, article_, blockquote, blockquote, blockquote_, content, content, content_, data, data, data_, division, division, division_, footer, footer, footer_, header, header, header_, lineBreakOpportunity, lineBreakOpportunity, navigation, navigation, navigation_, section6, section6_, sectionTitle6, sectionTitle6_, sidebar, sidebar, sidebar_, time, time, time_
Methods inherited from class org.apache.maven.doxia.sink.impl.AbstractSink
enableLogging, getLog, unifyEOLs
-
Field Details
-
TOC_NONE
public static final int TOC_NONENo Table Of Content.- See Also:
-
TOC_START
public static final int TOC_STARTTable Of Content at the start of the document.- See Also:
-
TOC_END
public static final int TOC_ENDTable Of Content at the end of the document.- See Also:
-
-
Constructor Details
-
FoAggregateSink
Constructor.- Parameters:
writer
- The writer for writing the result.
-
-
Method Details
-
head
public void head() -
head
public void head(org.apache.maven.doxia.sink.SinkEventAttributes attributes) -
head_
public void head_() -
title
public void title() -
title
public void title(org.apache.maven.doxia.sink.SinkEventAttributes attributes) -
title_
public void title_() -
author
public void author() -
author
public void author(org.apache.maven.doxia.sink.SinkEventAttributes attributes) -
author_
public void author_() -
date
public void date() -
date
public void date(org.apache.maven.doxia.sink.SinkEventAttributes attributes) -
date_
public void date_() -
body
public void body() -
body
public void body(org.apache.maven.doxia.sink.SinkEventAttributes attributes) -
body_
public void body_() -
setDocumentTitle
Sets the title of the current document. This is used as a chapter title in the page header.- Parameters:
title
- the title of the current document.
-
setDocumentName
Sets the name of the current source document, relative to the source root. Used to resolve links to other source documents.- Parameters:
name
- the name for the current document.
-
setDocumentModel
public void setDocumentModel(org.apache.maven.doxia.document.DocumentModel model) Sets the DocumentModel to be used by this sink. The DocumentModel provides all the meta-information required to render a document, eg settings for the cover page, table of contents, etc.
By default, a TOC will be added at the beginning of the document.- Parameters:
model
- the DocumentModel.- See Also:
-
setDocumentModel
public void setDocumentModel(org.apache.maven.doxia.document.DocumentModel model, int tocPos) Sets the DocumentModel to be used by this sink. The DocumentModel provides all the meta-information required to render a document, eg settings for the cover page, table of contents, etc. -
figureGraphics
- Specified by:
figureGraphics
in interfaceorg.apache.maven.doxia.sink.Sink
- Overrides:
figureGraphics
in classFoSink
-
figureGraphics
- Specified by:
figureGraphics
in interfaceorg.apache.maven.doxia.sink.Sink
- Overrides:
figureGraphics
in classFoSink
-
anchor
-
anchor
-
link
-
link
-
writeStartTag
Writes a start tag, prepending EOL.- Overrides:
writeStartTag
in classFoSink
- Parameters:
tag
- The tag.attributeId
- An id identifying the attribute set.
-
writeStartTag
Writes a start tag, prepending EOL.- Overrides:
writeStartTag
in classFoSink
- Parameters:
tag
- The tag.id
- An id to add.name
- The name (value) of the id.
-
writeEndTag
- Overrides:
writeEndTag
in classFoSink
- Parameters:
t
- aHTML.Tag
object.
-
writeEmptyTag
Writes a simple tag, appending EOL.- Overrides:
writeEmptyTag
in classFoSink
- Parameters:
tag
- The tag name.attributeId
- An id identifying the attribute set.
-
write
Writes a text, swallowing any exceptions. -
writeln
Writes a text, appending EOL. -
content
Writes content, escaping special characters. -
newline
protected void newline()Writes EOL. -
startPageSequence
Starts a page sequence, depending on the current chapter.- Parameters:
headerText
- The text to write in the header, if null, nothing is written.footerText
- The text to write in the footer, if null, nothing is written.
-
getHeaderText
Returns the text to write in the header of each page.- Returns:
- String
-
getChapterString
Returns the current chapter number as a string. By default does nothing, gets overridden by AggregateSink.- Overrides:
getChapterString
in classFoSink
- Returns:
- an empty String.
-
regionBefore
Writes a 'xsl-region-before' block.- Overrides:
regionBefore
in classFoSink
- Parameters:
headerText
- The text to write in the header, if null, nothing is written.
-
regionAfter
Writes a 'xsl-region-after' block. By default does nothing, gets overridden by AggregateSink.- Overrides:
regionAfter
in classFoSink
- Parameters:
footerText
- The text to write in the footer, if null, nothing is written.
-
chapterHeading
Writes a chapter heading. By default does nothing, gets overridden by AggregateSink.- Overrides:
chapterHeading
in classFoSink
- Parameters:
headerText
- The text to write in the header, if null, the current document title is written.chapterNumber
- True if the chapter number should be written in front of the text.
-
toc
public void toc()Writes a table of contents. The DocumentModel has to contain a DocumentTOC for this to work. -
pdfBookmarks
protected void pdfBookmarks()Writes a fo:bookmark-tree. The DocumentModel has to contain a DocumentTOC for this to work.- Overrides:
pdfBookmarks
in classFoSink
-
coverPage
public void coverPage()Writes a cover page. The DocumentModel has to contain a DocumentMeta for this to work.
-