public class FoAggregateSink extends FoSink
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.
Modifier and Type | Field and Description |
---|---|
static int |
TOC_END
Table Of Content at the end of the document.
|
static int |
TOC_NONE
No Table Of Content.
|
static int |
TOC_START
Table Of Content at the start of the document.
|
warnMessages
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
BANG, CDATA, DOCTYPE_START, ENTITY_START, XML_NAMESPACE
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
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
Constructor and Description |
---|
FoAggregateSink(Writer writer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
anchor(String name) |
void |
anchor(String name,
SinkEventAttributes attributes) |
void |
author_() |
void |
author() |
void |
author(SinkEventAttributes attributes) |
void |
body_() |
void |
body() |
void |
body(SinkEventAttributes attributes) |
protected void |
chapterHeading(String headerText,
boolean chapterNumber)
Writes a chapter heading.
|
protected void |
content(String text)
Writes content, escaping special characters.
|
void |
coverPage()
Writes a cover page.
|
void |
date_() |
void |
date() |
void |
date(SinkEventAttributes attributes) |
void |
figureGraphics(String name) |
void |
figureGraphics(String src,
SinkEventAttributes attributes) |
protected String |
getChapterString()
Returns the current chapter number as a string.
|
protected String |
getFooterText()
Returns the text to write in the footer of each page.
|
protected String |
getHeaderText()
Returns the text to write in the header of each page.
|
void |
head_() |
void |
head() |
void |
head(SinkEventAttributes attributes) |
void |
link(String name) |
void |
link(String name,
SinkEventAttributes attributes) |
protected void |
newline()
Writes EOL.
|
protected void |
pdfBookmarks()
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(DocumentModel model)
Sets the DocumentModel to be used by this sink.
|
void |
setDocumentModel(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() |
void |
title(SinkEventAttributes attributes) |
void |
toc()
Writes a table of contents.
|
protected void |
write(String text)
Writes a text, swallowing any exceptions.
|
protected void |
writeEmptyTag(HTML.Tag tag,
String attributeId)
Writes a simple tag, appending EOL.
|
protected void |
writeEndTag(HTML.Tag t)
Writes an end tag, appending EOL.
|
protected void |
writeln(String text)
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.
|
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, 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
getNameSpace, setInsertNewline, setNameSpace, writeEOL, writeSimpleTag, writeSimpleTag, writeStartTag, writeStartTag
enableLogging, getLog, unifyEOLs
public static int TOC_NONE
setDocumentModel(DocumentModel, int)
public static int TOC_START
setDocumentModel(DocumentModel, int)
public static int TOC_END
setDocumentModel(DocumentModel, int)
public FoAggregateSink(Writer writer)
writer
- The writer for writing the result.public void head(SinkEventAttributes attributes)
public void title(SinkEventAttributes attributes)
public void title_()
public void author()
public void author(SinkEventAttributes attributes)
public void author_()
public void date(SinkEventAttributes attributes)
public void body(SinkEventAttributes attributes)
public void setDocumentTitle(String title)
title
- the title of the current document.public void setDocumentName(String name)
name
- the name for the current document.public void setDocumentModel(DocumentModel model)
model
- the DocumentModel.#setDocumentModel(DocumentModel, String)
,
TOC_START
public void setDocumentModel(DocumentModel model, int tocPos)
public void figureGraphics(String name)
figureGraphics
in interface Sink
figureGraphics
in class FoSink
public void figureGraphics(String src, SinkEventAttributes attributes)
figureGraphics
in interface Sink
figureGraphics
in class FoSink
public void anchor(String name)
public void anchor(String name, SinkEventAttributes attributes)
public void link(String name)
public void link(String name, SinkEventAttributes attributes)
protected void writeStartTag(HTML.Tag tag, String attributeId)
writeStartTag
in class FoSink
tag
- The tag.attributeId
- An id identifying the attribute set.protected void writeStartTag(HTML.Tag tag, String id, String name)
writeStartTag
in class FoSink
tag
- The tag.id
- An id to add.name
- The name (value) of the id.protected void writeEndTag(HTML.Tag t)
writeEndTag
in class FoSink
protected void writeEmptyTag(HTML.Tag tag, String attributeId)
writeEmptyTag
in class FoSink
tag
- The tag name.attributeId
- An id identifying the attribute set.protected void write(String text)
protected void writeln(String text)
protected void content(String text)
protected void newline()
protected void startPageSequence(String headerText, String footerText)
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.protected String getHeaderText()
protected String getFooterText()
protected String getChapterString()
getChapterString
in class FoSink
protected void regionBefore(String headerText)
regionBefore
in class FoSink
headerText
- The text to write in the header, if null, nothing is written.protected void regionAfter(String footerText)
regionAfter
in class FoSink
footerText
- The text to write in the footer, if null, nothing is written.protected void chapterHeading(String headerText, boolean chapterNumber)
chapterHeading
in class FoSink
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.public void toc()
protected void pdfBookmarks()
pdfBookmarks
in class FoSink
public void coverPage()
Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.