org.apache.maven.doxia.sink
Class AbstractSink

java.lang.Object
  extended by org.apache.maven.doxia.sink.AbstractSink
All Implemented Interfaces:
LogEnabled, Markup, Sink
Direct Known Subclasses:
SinkAdapter

public abstract class AbstractSink
extends Object
implements Sink, Markup

An abstract base class that defines some convenience methods for sinks.

Since:
1.1
Version:
$Id: AbstractSink.java 1185112 2011-10-17 11:33:00Z ltheussl $
Author:
ltheussl, Vincent Siveton

Field Summary
 
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
 
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
 
Constructor Summary
AbstractSink()
           
 
Method Summary
 void enableLogging(Log log)
          Enable a Doxia logger for this Doxia component.
protected  Log getLog()
          Returns a logger for this sink.
protected  void init()
          This is called in Sink.head() or in Sink.close(), and can be used to set the sink into a clear state so it can be re-used.
protected static String unifyEOLs(String text)
          Parses the given String and replaces all occurrences of '\n', '\r' and '\r\n' with the system EOL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.doxia.sink.Sink
anchor_, anchor, anchor, author_, author, author, body_, body, body, bold_, bold, close, comment, date_, date, date, definedTerm_, definedTerm, definedTerm, definition_, definition, definition, definitionList_, definitionList, definitionList, definitionListItem_, definitionListItem, definitionListItem, figure_, figure, figure, figureCaption_, figureCaption, figureCaption, figureGraphics, figureGraphics, flush, head_, head, head, horizontalRule, horizontalRule, italic_, italic, lineBreak, lineBreak, link_, link, link, list_, list, list, listItem_, listItem, listItem, monospaced_, monospaced, nonBreakingSpace, numberedList_, numberedList, numberedList, numberedListItem_, numberedListItem, numberedListItem, pageBreak, paragraph_, paragraph, paragraph, rawText, 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, table_, table, table, tableCaption_, tableCaption, tableCaption, tableCell_, tableCell, tableCell, tableCell, tableHeaderCell_, tableHeaderCell, tableHeaderCell, tableHeaderCell, tableRow_, tableRow, tableRow, tableRows_, tableRows, text, text, title_, title, title, unknown, verbatim_, verbatim, verbatim
 

Constructor Detail

AbstractSink

public AbstractSink()
Method Detail

enableLogging

public void enableLogging(Log log)
Enable a Doxia logger for this Doxia component.

Specified by:
enableLogging in interface LogEnabled
Parameters:
log - a Log.

getLog

protected Log getLog()
Returns a logger for this sink. If no logger has been configured, a new SystemStreamLog is returned.

Returns:
Log

unifyEOLs

protected static String unifyEOLs(String text)
Parses the given String and replaces all occurrences of '\n', '\r' and '\r\n' with the system EOL. All Sinks should make sure that text output is filtered through this method.

Parameters:
text - the text to scan. May be null in which case null is returned.
Returns:
a String that contains only System EOLs.

init

protected void init()
This is called in Sink.head() or in Sink.close(), and can be used to set the sink into a clear state so it can be re-used.

Since:
1.1.2


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.