|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.maven.doxia.sink.AbstractSink org.apache.maven.doxia.sink.SinkAdapter org.apache.maven.doxia.sink.AbstractXmlSink org.apache.maven.doxia.module.fo.FoSink org.apache.maven.doxia.module.fo.FoAggregateSink
public class FoAggregateSink
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.
Field Summary | |
---|---|
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. |
Fields inherited from class org.apache.maven.doxia.module.fo.FoSink |
---|
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.XmlMarkup |
---|
BANG, CDATA, DOCTYPE_START, ENTITY_START, XML_NAMESPACE |
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 |
Constructor Summary | |
---|---|
FoAggregateSink(Writer writer)
Constructor. |
Method Summary | |
---|---|
void |
anchor(String name)
Starts an element which defines an anchor. |
void |
anchor(String name,
SinkEventAttributes attributes)
Starts an element which defines an anchor.
The ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
Supported attributes are the |
void |
author_()
Ends an author element. |
void |
author()
Starts an author element. |
void |
author(SinkEventAttributes attributes)
Starts an author element. This is used to identify the author of the document.
Supported attributes are: |
void |
body_()
Ends the body element. |
void |
body()
Starts the body of a document. |
void |
body(SinkEventAttributes attributes)
Starts the body of a document. This contains the document's content.
Supported attributes are the |
protected void |
chapterHeading(String headerText,
boolean chapterNumber)
Writes a chapter heading. Writes a chapter heading. |
protected void |
content(String text)
Writes content, escaping special characters. Writes content, escaping special characters. |
void |
coverPage()
Writes a cover page. |
void |
date_()
Ends the date element. |
void |
date()
Starts the date element. The date is recommended (but it is not a requirement) to be align to the ISO-8601 standard, i.e.: YYYY-MM-DDwhere
|
void |
date(SinkEventAttributes attributes)
Starts the date element. This is used to identify the date of the document. Supported attributes are: none. |
void |
figureGraphics(String name)
Adding a source of a graphic. |
void |
figureGraphics(String src,
SinkEventAttributes attributes)
Adds a graphic element.
The
Supported attributes are the
If the |
protected String |
getChapterString()
Returns the current chapter number as a string. 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_()
Ends the head element. |
void |
head()
Starts the head element. |
void |
head(SinkEventAttributes attributes)
Starts the head element.
This contains information about the current document, (eg its title) that is not
considered document content. The head element is optional but if it exists, it has to be
unique within a sequence of Sink events that produces one output document, and it has
to come before the The canonical sequence of events for the head element is: sink.head(); sink.title(); sink.text( "Title" ); sink.title_(); sink.author(); sink.text( "Author" ); sink.author_(); sink.date(); sink.text( "Date" ); sink.date_(); sink.head_(); but none of the enclosed events is required. However, if they exist they have to occur in the order shown, and the title() and date() events have to be unique (author() events may occur any number of times). Supported attributes are:
|
void |
link(String name)
Starts an element which defines a link. |
void |
link(String name,
SinkEventAttributes attributes)
Starts a link.
The
Supported attributes are the
If |
protected void |
newline()
Writes EOL. |
protected void |
pdfBookmarks()
Writes a fo:bookmark-tree. Writes a fo:bookmark-tree. |
protected void |
regionAfter(String footerText)
Writes a 'xsl-region-after' block. Writes a 'xsl-region-after' block. |
protected void |
regionBefore(String headerText)
Writes a 'xsl-region-before' block. 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_()
Ends the title element. |
void |
title()
Starts the title element. |
void |
title(SinkEventAttributes attributes)
Starts the title element. This is used to identify the document.
Supported attributes are the |
void |
toc()
Writes a table of contents. |
protected void |
write(String text)
Write a text to the sink. Writes a text, swallowing any exceptions. Writes a text, swallowing any exceptions. |
protected void |
writeEmptyTag(HTML.Tag tag,
String attributeId)
Writes a simple tag, appending EOL. Writes a simple tag, appending EOL. |
protected void |
writeEndTag(HTML.Tag t)
Ends a Tag without writing an EOL. For instance: </tag>. Writes an end tag, appending EOL. |
protected void |
writeln(String text)
Writes a text, appending EOL. Writes a text, appending EOL. |
protected void |
writeStartTag(HTML.Tag tag,
String attributeId)
Writes a start tag, prepending EOL. Writes a start tag, prepending EOL. |
protected void |
writeStartTag(HTML.Tag tag,
String id,
String name)
Writes a start tag, prepending EOL. Writes a start tag, prepending EOL. |
Methods inherited from class org.apache.maven.doxia.sink.AbstractXmlSink |
---|
getNameSpace, setNameSpace, writeEOL, writeSimpleTag, writeSimpleTag, writeStartTag, writeStartTag |
Methods inherited from class org.apache.maven.doxia.sink.AbstractSink |
---|
enableLogging, getLog, unifyEOLs |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int TOC_NONE
setDocumentModel(DocumentModel, int)
public static int TOC_START
setDocumentModel(DocumentModel, int)
public static int TOC_END
setDocumentModel(DocumentModel, int)
Constructor Detail |
---|
public FoAggregateSink(Writer writer)
writer
- The writer for writing the result.Method Detail |
---|
public void head()
head
in interface Sink
head
in class FoSink
Sink.head(SinkEventAttributes)
public void head(SinkEventAttributes attributes)
This contains information about the current document, (eg its title) that is not
considered document content. The head element is optional but if it exists, it has to be
unique within a sequence of Sink events that produces one output document, and it has
to come before the Sink.body(SinkEventAttributes)
element.
The canonical sequence of events for the head element is:
sink.head(); sink.title(); sink.text( "Title" ); sink.title_(); sink.author(); sink.text( "Author" ); sink.author_(); sink.date(); sink.text( "Date" ); sink.date_(); sink.head_();
but none of the enclosed events is required. However, if they exist they have to occur in the order shown, and the title() and date() events have to be unique (author() events may occur any number of times).
Supported attributes are:
PROFILE
,LANG
.
head
in interface Sink
head
in class FoSink
attributes
- A set of SinkEventAttributes
, may be null
.public void head_()
head_
in interface Sink
head_
in class FoSink
public void title()
title
in interface Sink
title
in class FoSink
Sink.title(SinkEventAttributes)
public void title(SinkEventAttributes attributes)
Supported attributes are the base attributes
.
title
in interface Sink
title
in class FoSink
attributes
- A set of SinkEventAttributes
, may be null
.Sink.head(SinkEventAttributes)
public void title_()
title_
in interface Sink
title_
in class FoSink
public void author()
author
in interface Sink
author
in class FoSink
Sink.author(SinkEventAttributes)
public void author(SinkEventAttributes attributes)
Supported attributes are: EMAIL
.
author
in interface Sink
author
in class FoSink
attributes
- A set of SinkEventAttributes
, may be null
.Sink.head(SinkEventAttributes)
public void author_()
author_
in interface Sink
author_
in class FoSink
public void date()
YYYY-MM-DDwhere
date
in interface Sink
date
in class FoSink
Sink.date(SinkEventAttributes)
public void date(SinkEventAttributes attributes)
Supported attributes are: none.
date
in interface Sink
date
in class FoSink
attributes
- A set of SinkEventAttributes
, may be null
.Sink.head(SinkEventAttributes)
public void date_()
date_
in interface Sink
date_
in class FoSink
public void body()
body
in interface Sink
body
in class FoSink
Sink.body(SinkEventAttributes)
public void body(SinkEventAttributes attributes)
Supported attributes are the base attributes
.
body
in interface Sink
body
in class FoSink
attributes
- A set of SinkEventAttributes
, may be null
.Sink.head(SinkEventAttributes)
public void body_()
body_
in interface Sink
body_
in class FoSink
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)
model
- the DocumentModel, could be null.tocPos
- should be one of these values: TOC_NONE
, TOC_START
and TOC_END
.public void figureGraphics(String name)
figureGraphics
in interface Sink
figureGraphics
in class FoSink
name
- the sourcepublic void figureGraphics(String src, SinkEventAttributes attributes)
The src
parameter should be a valid link, ie it can be an absolute
URL or a link relative to the current source document.
Supported attributes are the base attributes
plus:
SRC
,ALT
,WIDTH
,HEIGHT
,ALIGN
,BORDER
,HSPACE
,VSPACE
,ISMAP
,USEMAP
.
If the SRC
attribute is specified in SinkEventAttributes,
it will be overridden by the src
parameter.
figureGraphics
in interface Sink
figureGraphics
in class FoSink
src
- the image source, a valid URL.attributes
- A set of SinkEventAttributes
, may be null
.Sink.figure(SinkEventAttributes)
public void anchor(String name)
anchor
in interface Sink
anchor
in class FoSink
name
- the name of the anchor.Sink.anchor(String,SinkEventAttributes)
public void anchor(String name, SinkEventAttributes attributes)
The name
parameter has to be a valid SGML NAME token.
According to the
HTML 4.01 specification section 6.2 SGML basic types:
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
Supported attributes are the base attributes
.
If NAME
is specified in the SinkEventAttributes,
it will be overwritten by the name
parameter.
anchor
in interface Sink
anchor
in class FoSink
name
- the name of the anchor. This has to be a valid SGML NAME token.attributes
- A set of SinkEventAttributes
, may be null
.public void link(String name)
link
in interface Sink
link
in class FoSink
name
- the name of the link.Sink.link(String,SinkEventAttributes)
public void link(String name, SinkEventAttributes attributes)
The name
parameter has to be a valid html href
parameter, ie for internal links (links to an anchor within the same source
document), name
should start with the character "#".
Supported attributes are the base attributes
plus:
CHARSET
,COORDS
,HREF
,HREFLANG
,REL
,REV
,SHAPE
,TARGET
,TYPE
.
If HREF
is specified in the
SinkEventAttributes, it will be overwritten by the name
parameter.
link
in interface Sink
link
in class FoSink
name
- the name of the link.attributes
- A set of SinkEventAttributes
, may be null
.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)
</tag>. Writes an end tag, appending EOL.
writeEndTag
in class FoSink
t
- a tag.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)
write
in class FoSink
text
- the given text to writeprotected void writeln(String text)
writeln
in class FoSink
text
- The text to write.protected void content(String text)
content
in class FoSink
text
- The text to write.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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |