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

java.lang.Object
  extended byorg.apache.maven.doxia.sink.SinkAdapter
      extended byorg.apache.maven.doxia.sink.AbstractTextSink
          extended byorg.apache.maven.doxia.module.latex.LatexSink
All Implemented Interfaces:
Markup, Sink, TextMarkup

public class LatexSink
extends AbstractTextSink

Latex Sink implementation.

Since:
1.0
Plexus component:
role:
"org.apache.maven.doxia.sink.Sink"
role-hint:
"tex"

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_()
          
 void anchor(String name)
          
 void author_()
          
 void author()
          
 void body_()
          
 void body()
          
 void bold_()
          
 void bold()
          
 void close()
          
protected  void content(String text)
          Writes the text, without preserving whitespace.
 void date_()
          
 void date()
          
static String defaultPreamble()
          Returns the default preamble.
static String defaultSinkCommands()
          Returns the default sink commands.
 void definedTerm_()
          
 void definedTerm()
          
 void definitionList_()
          
 void definitionList()
          
protected static String escaped(String text)
          Escapes special characters.
 void figure_()
          
 void figure()
          
 void figureCaption_()
          
 void figureCaption()
          
 void figureGraphics(String name)
          
 void flush()
          
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()
          
 void horizontalRule()
          
 void italic_()
          
 void italic()
          
 void lineBreak()
          
 void link_()
          
 void link(String name)
          
 void list_()
          
 void list()
          
 void listItem()
          
protected  void markup(String text)
          Writes the text, preserving whitespace.
 void monospaced_()
          
 void monospaced()
          
 void nonBreakingSpace()
          
 void numberedList_()
          
 void numberedList(int numbering)
          
 void numberedListItem()
          
 void pageBreak()
          
 void paragraph_()
          
 void sectionTitle_()
          
 void sectionTitle1_()
          
 void sectionTitle1()
          
 void sectionTitle2_()
          
 void sectionTitle2()
          
 void sectionTitle3_()
          
 void sectionTitle3()
          
 void sectionTitle4_()
          
 void sectionTitle4()
          
 void sectionTitle5_()
          
 void sectionTitle5()
          
 void table_()
          
 void table()
          
 void tableCaption_()
          
 void tableCaption()
          
 void tableCell_()
          
 void tableCell_(boolean header)
          Ends a table cell.
 void tableCell()
          
 void tableCell(boolean header)
          Starts a table cell.
 void tableHeaderCell_()
          
 void tableHeaderCell()
          
 void tableRow_()
          
 void tableRow()
          
 void tableRows_()
          
 void tableRows(int[] justification, boolean grid)
          
 void text(String text)
          
 void title_()
          
 void title()
          
 void verbatim_()
          
 void verbatim(boolean boxed)
          
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()


body

public void body()


body_

public void body_()


sectionTitle1

public void sectionTitle1()


sectionTitle1_

public void sectionTitle1_()


sectionTitle2

public void sectionTitle2()


sectionTitle2_

public void sectionTitle2_()


sectionTitle3

public void sectionTitle3()


sectionTitle3_

public void sectionTitle3_()


sectionTitle4

public void sectionTitle4()


sectionTitle4_

public void sectionTitle4_()


sectionTitle5

public void sectionTitle5()


sectionTitle5_

public void sectionTitle5_()


list

public void list()


list_

public void list_()


listItem

public void listItem()


numberedList

public void numberedList(int numbering)


numberedList_

public void numberedList_()


numberedListItem

public void numberedListItem()


definitionList

public void definitionList()


definitionList_

public void definitionList_()


figure

public void figure()


figure_

public void figure_()


table

public void table()


table_

public void table_()


tableRows

public void tableRows(int[] justification,
                      boolean grid)


tableRows_

public void tableRows_()


tableRow

public void tableRow()


tableRow_

public void tableRow_()


title

public void title()


title_

public void title_()


author

public void author()


author_

public void author_()


date

public void date()


date_

public void date_()


sectionTitle_

public void sectionTitle_()


paragraph_

public void paragraph_()


verbatim

public void verbatim(boolean boxed)


verbatim_

public void verbatim_()


definedTerm

public void definedTerm()


definedTerm_

public void definedTerm_()


figureCaption

public void figureCaption()


figureCaption_

public void figureCaption_()


tableCell

public void tableCell()


tableCell_

public void tableCell_()


tableHeaderCell

public void tableHeaderCell()


tableHeaderCell_

public void tableHeaderCell_()


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()


tableCaption_

public void tableCaption_()


figureGraphics

public void figureGraphics(String name)


horizontalRule

public void horizontalRule()


pageBreak

public void pageBreak()


anchor

public void anchor(String name)


anchor_

public void anchor_()


link

public void link(String name)


link_

public void link_()


italic

public void italic()


italic_

public void italic_()


bold

public void bold()


bold_

public void bold_()


monospaced

public void monospaced()


monospaced_

public void monospaced_()


lineBreak

public void lineBreak()


nonBreakingSpace

public void nonBreakingSpace()


text

public void text(String text)


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()


close

public void close()


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-2009 The Apache Software Foundation. All Rights Reserved.