org.apache.maven.doxia.module.latex
Class LatexSink

java.lang.Object
  extended by org.apache.maven.doxia.sink.SinkAdapter
      extended by org.apache.maven.doxia.sink.AbstractTextSink
          extended by org.apache.maven.doxia.module.latex.LatexSink
All Implemented Interfaces:
Markup, TextMarkup, Sink
Direct Known Subclasses:
LatexBookSink

public class LatexSink
extends AbstractTextSink

Latex Sink implementation.

Since:
1.0

Field Summary
 
Fields inherited from interface org.apache.maven.doxia.markup.TextMarkup
PIPE
 
Fields inherited from interface org.apache.maven.doxia.markup.Markup
EOL, EQUAL, GREATER_THAN, LEFT_CURLY_BRACKET, LEFT_SQUARE_BRACKET, LESS_THAN, MINUS, PLUS, QUOTE, RIGHT_CURLY_BRACKET, RIGHT_SQUARE_BRACKET, SLASH, SPACE, STAR
 
Fields inherited from interface org.apache.maven.doxia.sink.Sink
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
LatexSink(Writer out)
          Constructor.
LatexSink(Writer out, String sinkCommands, String preamble)
          Constructor.
LatexSink(Writer out, String sinkCommands, String preamble, boolean fragmentDocument)
          Constructor.
 
Method Summary
 void anchor_()
          Ending an anchor element.
 void anchor(String name)
          Starting an element which defines an anchor.
 void author_()
          Ending the author element.
 void author()
          Starting the author element which is used to identify the author of the document.
 void body_()
          Ending the body element.
 void body()
          Starting the body of a document which contains the document's content.
 void bold_()
          Ending a bold element.
 void bold()
          Starting a bold element.
 void close()
          Close the writer or the stream, if needed.
protected  void content(String text)
          Writes the text, without preserving whitespace.
 void date_()
          Ending the date element.
 void date()
          Starting the date element which is used to identify the date of the document.
static String defaultPreamble()
          Returns the default preamble.
static String defaultSinkCommands()
          Returns the default sink commands.
 void definedTerm_()
          Starting a definition term element within a definition list.
 void definedTerm()
          Starting a definition term element within a definition list.
 void definitionList_()
          Ending a definition list element.
 void definitionList()
          Starting a definition list element.
protected static String escaped(String text)
          Escapes special characters.
 void figure_()
          Ending a basic image embedding element.
 void figure()
          Starting a basic image embedding element.
 void figureCaption_()
          Ending a caption of an image.
 void figureCaption()
          Starting a caption of an image element.
 void figureGraphics(String name)
          Adding a source of a graphic.
 void flush()
          Flush the writer or the stream, if needed.
static InputStream getDefaultPreamble()
          Returns the default preamble from a resource.
static InputStream getDefaultSinkCommands()
          Returns the default sink commands from a resource.
protected  String getDocumentBegin()
          Returns a default \begin{document} declaration.
protected  String getDocumentEnd()
          Returns a default \end{document} declaration.
protected  String getDocumentStart()
          Returns a default \documentclass declaration.
 void head()
          Starting the head element which contains information about the current document, such as its title, that is not considered document content.
 void horizontalRule()
          Adding a separator of sections from a text to each other.
 void italic_()
          Ending an italic element.
 void italic()
          Starting an italic element.
 void lineBreak()
          Adding a line breaks.
 void link_()
          Ending a link element.
 void link(String name)
          Starting an element which defines a link.
 void list_()
          Ending an unordered list element.
 void list()
          Starting an unordered list element.
 void listItem()
          Starting a list item element within an unordered list.
protected  void markup(String text)
          Writes the text, preserving whitespace.
 void monospaced_()
          Ending a monospaced element.
 void monospaced()
          Starting a monospaced element.
 void nonBreakingSpace()
          Adding a non breaking space, ie a space without any special formatting operations.
 void numberedList_()
          Ending an ordered list element.
 void numberedList(int numbering)
          Starting an ordered list element.
 void numberedListItem()
          Starting a list item element within an ordered list.
 void pageBreak()
          Adding a new page separator.
 void paragraph_()
          Ending a paragraph element.
 void sectionTitle_()
          Ending a title heading element.
 void sectionTitle1_()
          Ending a first title heading element.
 void sectionTitle1()
          Starting a first title heading element.
 void sectionTitle2_()
          Ending a second title heading element.
 void sectionTitle2()
          Starting a second title heading element.
 void sectionTitle3_()
          Ending a third title heading element.
 void sectionTitle3()
          Starting a third title heading element.
 void sectionTitle4_()
          Ending a 4th title heading element.
 void sectionTitle4()
          Starting a 4th title heading element.
 void sectionTitle5_()
          Ending a 5th title heading element.
 void sectionTitle5()
          Starting a 5th title heading element.
 void table_()
          Ending a table element.
 void table()
          Starting a table element for marking up tabular information in a document.
 void tableCaption_()
          Ending a caption element of a table.
 void tableCaption()
          Starting a caption element of a table.
 void tableCell_()
          Ending a cell element.
 void tableCell_(boolean header)
          Ends a table cell.
 void tableCell()
          Starting a cell element which defines a cell that contains data.
 void tableCell(boolean header)
          Starts a table cell.
 void tableHeaderCell_()
          Ending a cell header element.
 void tableHeaderCell()
          Starting a cell element which defines a cell that contains header information.
 void tableRow_()
          Ending a row element.
 void tableRow()
          Starting a row element which acts as a container for a row of table cells.
 void tableRows_()
          Ending an element contains rows of table data.
 void tableRows(int[] justification, boolean grid)
          Starting an element contains rows of table data.
 void text(String text)
          Adding a text.
 void title_()
          Ending the title element.
 void title()
          Starting the title element which is used to identify the document.
 void verbatim_()
          Ending a verbatim element.
 void verbatim(boolean boxed)
          Starting an element which indicates that whitespace in the enclosed text has semantic relevance.
protected  void verbatimContent(String text)
          Writes the text, preserving whitespace.
 
Methods inherited from class org.apache.maven.doxia.sink.SinkAdapter
definition_, definition, definitionListItem_, definitionListItem, head_, listItem_, numberedListItem_, paragraph, rawText, section1_, section1, section2_, section2, section3_, section3, section4_, section4, section5_, section5, sectionTitle, tableCell, tableHeaderCell
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LatexSink

public LatexSink(Writer out)
Constructor.

Parameters:
out - The writer to use.

LatexSink

public LatexSink(Writer out,
                 String sinkCommands,
                 String preamble)
Constructor.

Parameters:
out - The writer to use.
sinkCommands - A String representation of commands that go before \documentclass.
preamble - A String representation of commands that go between \documentclass and \begin{document}.

LatexSink

public LatexSink(Writer out,
                 String sinkCommands,
                 String preamble,
                 boolean fragmentDocument)
Constructor.

Parameters:
out - The writer to use.
sinkCommands - A String representation of commands that go before \documentclass.
preamble - A String representation of commands that go between \documentclass and \begin{document}.
fragmentDocument - If this receives events that that are only part of a document. Typically, headers are omitted if this is true.
Method Detail

getDocumentStart

protected String getDocumentStart()
Returns a default \documentclass declaration.

Returns:
String.

getDocumentBegin

protected String getDocumentBegin()
Returns a default \begin{document} declaration.

Returns:
String.

getDocumentEnd

protected String getDocumentEnd()
Returns a default \end{document} declaration.

Returns:
String.

head

public void head()
Starting the head element which contains information about the current document, such as its title, that is not considered document content.

Specified by:
head in interface Sink
Overrides:
head in class SinkAdapter

body

public void body()
Starting the body of a document which contains the document's content.

Specified by:
body in interface Sink
Overrides:
body in class SinkAdapter

body_

public void body_()
Ending the body element.

Specified by:
body_ in interface Sink
Overrides:
body_ in class SinkAdapter

sectionTitle1

public void sectionTitle1()
Starting a first title heading element.

Specified by:
sectionTitle1 in interface Sink
Overrides:
sectionTitle1 in class SinkAdapter

sectionTitle1_

public void sectionTitle1_()
Ending a first title heading element.

Specified by:
sectionTitle1_ in interface Sink
Overrides:
sectionTitle1_ in class SinkAdapter

sectionTitle2

public void sectionTitle2()
Starting a second title heading element.

Specified by:
sectionTitle2 in interface Sink
Overrides:
sectionTitle2 in class SinkAdapter

sectionTitle2_

public void sectionTitle2_()
Ending a second title heading element.

Specified by:
sectionTitle2_ in interface Sink
Overrides:
sectionTitle2_ in class SinkAdapter

sectionTitle3

public void sectionTitle3()
Starting a third title heading element.

Specified by:
sectionTitle3 in interface Sink
Overrides:
sectionTitle3 in class SinkAdapter

sectionTitle3_

public void sectionTitle3_()
Ending a third title heading element.

Specified by:
sectionTitle3_ in interface Sink
Overrides:
sectionTitle3_ in class SinkAdapter

sectionTitle4

public void sectionTitle4()
Starting a 4th title heading element.

Specified by:
sectionTitle4 in interface Sink
Overrides:
sectionTitle4 in class SinkAdapter

sectionTitle4_

public void sectionTitle4_()
Ending a 4th title heading element.

Specified by:
sectionTitle4_ in interface Sink
Overrides:
sectionTitle4_ in class SinkAdapter

sectionTitle5

public void sectionTitle5()
Starting a 5th title heading element.

Specified by:
sectionTitle5 in interface Sink
Overrides:
sectionTitle5 in class SinkAdapter

sectionTitle5_

public void sectionTitle5_()
Ending a 5th title heading element.

Specified by:
sectionTitle5_ in interface Sink
Overrides:
sectionTitle5_ in class SinkAdapter

list

public void list()
Starting an unordered list element.

Specified by:
list in interface Sink
Overrides:
list in class SinkAdapter

list_

public void list_()
Ending an unordered list element.

Specified by:
list_ in interface Sink
Overrides:
list_ in class SinkAdapter

listItem

public void listItem()
Starting a list item element within an unordered list.

Specified by:
listItem in interface Sink
Overrides:
listItem in class SinkAdapter

numberedList

public void numberedList(int numbering)
Starting an ordered list element.

Specified by:
numberedList in interface Sink
Overrides:
numberedList in class SinkAdapter
Parameters:
numbering - the numbering wanted
See Also:
Sink.NUMBERING_DECIMAL, Sink.NUMBERING_LOWER_ALPHA, Sink.NUMBERING_LOWER_ROMAN, Sink.NUMBERING_UPPER_ALPHA, Sink.NUMBERING_UPPER_ROMAN

numberedList_

public void numberedList_()
Ending an ordered list element.

Specified by:
numberedList_ in interface Sink
Overrides:
numberedList_ in class SinkAdapter

numberedListItem

public void numberedListItem()
Starting a list item element within an ordered list.

Specified by:
numberedListItem in interface Sink
Overrides:
numberedListItem in class SinkAdapter

definitionList

public void definitionList()
Starting a definition list element.

Specified by:
definitionList in interface Sink
Overrides:
definitionList in class SinkAdapter

definitionList_

public void definitionList_()
Ending a definition list element.

Specified by:
definitionList_ in interface Sink
Overrides:
definitionList_ in class SinkAdapter

figure

public void figure()
Starting a basic image embedding element.

Specified by:
figure in interface Sink
Overrides:
figure in class SinkAdapter

figure_

public void figure_()
Ending a basic image embedding element.

Specified by:
figure_ in interface Sink
Overrides:
figure_ in class SinkAdapter

table

public void table()
Starting a table element for marking up tabular information in a document.

Specified by:
table in interface Sink
Overrides:
table in class SinkAdapter

table_

public void table_()
Ending a table element.

Specified by:
table_ in interface Sink
Overrides:
table_ in class SinkAdapter

tableRows

public void tableRows(int[] justification,
                      boolean grid)
Starting an element contains rows of table data.

Specified by:
tableRows in interface Sink
Overrides:
tableRows in class SinkAdapter
Parameters:
justification - the justification wanted
grid - true to provide a grid, false otherwise

tableRows_

public void tableRows_()
Ending an element contains rows of table data.

Specified by:
tableRows_ in interface Sink
Overrides:
tableRows_ in class SinkAdapter

tableRow

public void tableRow()
Starting a row element which acts as a container for a row of table cells.

Specified by:
tableRow in interface Sink
Overrides:
tableRow in class SinkAdapter

tableRow_

public void tableRow_()
Ending a row element.

Specified by:
tableRow_ in interface Sink
Overrides:
tableRow_ in class SinkAdapter

title

public void title()
Starting the title element which is used to identify the document.

Specified by:
title in interface Sink
Overrides:
title in class SinkAdapter

title_

public void title_()
Ending the title element.

Specified by:
title_ in interface Sink
Overrides:
title_ in class SinkAdapter

author

public void author()
Starting the author element which is used to identify the author of the document.

Specified by:
author in interface Sink
Overrides:
author in class SinkAdapter

author_

public void author_()
Ending the author element.

Specified by:
author_ in interface Sink
Overrides:
author_ in class SinkAdapter

date

public void date()
Starting the date element which is used to identify the date of the document.

Specified by:
date in interface Sink
Overrides:
date in class SinkAdapter

date_

public void date_()
Ending the date element.

Specified by:
date_ in interface Sink
Overrides:
date_ in class SinkAdapter

sectionTitle_

public void sectionTitle_()
Ending a title heading element.

Specified by:
sectionTitle_ in interface Sink
Overrides:
sectionTitle_ in class SinkAdapter

paragraph_

public void paragraph_()
Ending a paragraph element.

Specified by:
paragraph_ in interface Sink
Overrides:
paragraph_ in class SinkAdapter

verbatim

public void verbatim(boolean boxed)
Starting an element which indicates that whitespace in the enclosed text has semantic relevance.

Specified by:
verbatim in interface Sink
Overrides:
verbatim in class SinkAdapter
Parameters:
boxed - true to add a box, false otherwise

verbatim_

public void verbatim_()
Ending a verbatim element.

Specified by:
verbatim_ in interface Sink
Overrides:
verbatim_ in class SinkAdapter

definedTerm

public void definedTerm()
Starting a definition term element within a definition list.

Specified by:
definedTerm in interface Sink
Overrides:
definedTerm in class SinkAdapter

definedTerm_

public void definedTerm_()
Starting a definition term element within a definition list.

Specified by:
definedTerm_ in interface Sink
Overrides:
definedTerm_ in class SinkAdapter

figureCaption

public void figureCaption()
Starting a caption of an image element.

Specified by:
figureCaption in interface Sink
Overrides:
figureCaption in class SinkAdapter

figureCaption_

public void figureCaption_()
Ending a caption of an image.

Specified by:
figureCaption_ in interface Sink
Overrides:
figureCaption_ in class SinkAdapter

tableCell

public void tableCell()
Starting a cell element which defines a cell that contains data.

Specified by:
tableCell in interface Sink
Overrides:
tableCell in class SinkAdapter

tableCell_

public void tableCell_()
Ending a cell element.

Specified by:
tableCell_ in interface Sink
Overrides:
tableCell_ in class SinkAdapter

tableHeaderCell

public void tableHeaderCell()
Starting a cell element which defines a cell that contains header information.

Specified by:
tableHeaderCell in interface Sink
Overrides:
tableHeaderCell in class SinkAdapter

tableHeaderCell_

public void tableHeaderCell_()
Ending a cell header element.

Specified by:
tableHeaderCell_ in interface Sink
Overrides:
tableHeaderCell_ in class SinkAdapter

tableCell

public void tableCell(boolean header)
Starts a table cell.

Parameters:
header - True if this is a header cell.

tableCell_

public void tableCell_(boolean header)
Ends a table cell.

Parameters:
header - True if this is a header cell.

tableCaption

public void tableCaption()
Starting a caption element of a table.

Specified by:
tableCaption in interface Sink
Overrides:
tableCaption in class SinkAdapter

tableCaption_

public void tableCaption_()
Ending a caption element of a table.

Specified by:
tableCaption_ in interface Sink
Overrides:
tableCaption_ in class SinkAdapter

figureGraphics

public void figureGraphics(String name)
Adding a source of a graphic.

Specified by:
figureGraphics in interface Sink
Overrides:
figureGraphics in class SinkAdapter
Parameters:
name - the source

horizontalRule

public void horizontalRule()
Adding a separator of sections from a text to each other.

Specified by:
horizontalRule in interface Sink
Overrides:
horizontalRule in class SinkAdapter

pageBreak

public void pageBreak()
Adding a new page separator.

Specified by:
pageBreak in interface Sink
Overrides:
pageBreak in class SinkAdapter

anchor

public void anchor(String name)
Starting an element which defines an anchor.

Specified by:
anchor in interface Sink
Overrides:
anchor in class SinkAdapter
Parameters:
name - the name of the anchor

anchor_

public void anchor_()
Ending an anchor element.

Specified by:
anchor_ in interface Sink
Overrides:
anchor_ in class SinkAdapter

link

public void link(String name)
Starting an element which defines a link.

Specified by:
link in interface Sink
Overrides:
link in class SinkAdapter
Parameters:
name - the name of the link

link_

public void link_()
Ending a link element.

Specified by:
link_ in interface Sink
Overrides:
link_ in class SinkAdapter

italic

public void italic()
Starting an italic element.

Specified by:
italic in interface Sink
Overrides:
italic in class SinkAdapter

italic_

public void italic_()
Ending an italic element.

Specified by:
italic_ in interface Sink
Overrides:
italic_ in class SinkAdapter

bold

public void bold()
Starting a bold element.

Specified by:
bold in interface Sink
Overrides:
bold in class SinkAdapter

bold_

public void bold_()
Ending a bold element.

Specified by:
bold_ in interface Sink
Overrides:
bold_ in class SinkAdapter

monospaced

public void monospaced()
Starting a monospaced element.

Specified by:
monospaced in interface Sink
Overrides:
monospaced in class SinkAdapter

monospaced_

public void monospaced_()
Ending a monospaced element.

Specified by:
monospaced_ in interface Sink
Overrides:
monospaced_ in class SinkAdapter

lineBreak

public void lineBreak()
Adding a line breaks.

Specified by:
lineBreak in interface Sink
Overrides:
lineBreak in class SinkAdapter

nonBreakingSpace

public void nonBreakingSpace()
Adding a non breaking space, ie a space without any special formatting operations.

Specified by:
nonBreakingSpace in interface Sink
Overrides:
nonBreakingSpace in class SinkAdapter

text

public void text(String text)
Adding a text.

Specified by:
text in interface Sink
Overrides:
text in class SinkAdapter
Parameters:
text - The text to write.

markup

protected void markup(String text)
Writes the text, preserving whitespace.

Parameters:
text - the text to write.

content

protected void content(String text)
Writes the text, without preserving whitespace.

Parameters:
text - the text to write.

verbatimContent

protected void verbatimContent(String text)
Writes the text, preserving whitespace.

Parameters:
text - the text to write.

escaped

protected static String escaped(String text)
Escapes special characters.

Parameters:
text - The text to escape.
Returns:
The text with special characters replaced.

flush

public void flush()
Flush the writer or the stream, if needed.

Specified by:
flush in interface Sink
Overrides:
flush in class SinkAdapter

close

public void close()
Close the writer or the stream, if needed.

Specified by:
close in interface Sink
Overrides:
close in class SinkAdapter

getDefaultSinkCommands

public static InputStream getDefaultSinkCommands()
                                          throws IOException
Returns the default sink commands from a resource.

Returns:
InputStream
Throws:
IOException - if the resource file cannot be read.

getDefaultPreamble

public static InputStream getDefaultPreamble()
                                      throws IOException
Returns the default preamble from a resource.

Returns:
InputStream
Throws:
IOException - if the resource file cannot be read.

defaultSinkCommands

public static String defaultSinkCommands()
Returns the default sink commands.

Returns:
String.

defaultPreamble

public static String defaultPreamble()
Returns the default preamble.

Returns:
String.


Copyright © 2005-2010 Apache Software Foundation. All Rights Reserved.