Package org.apache.maven.doxia.sink.impl
Class AbstractSink
- java.lang.Object
-
- org.apache.maven.doxia.sink.impl.AbstractSink
-
- All Implemented Interfaces:
org.apache.maven.doxia.logging.LogEnabled
,Markup
,org.apache.maven.doxia.sink.Sink
- Direct Known Subclasses:
SinkAdapter
public abstract class AbstractSink extends java.lang.Object implements org.apache.maven.doxia.sink.Sink, Markup
An abstract base class that defines some convenience methods for sinks.- Since:
- 1.1
- Author:
- ltheussl, Vincent Siveton
-
-
Field Summary
-
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, SECTION_LEVEL_6
-
-
Constructor Summary
Constructors Constructor Description AbstractSink()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enableLogging(org.apache.maven.doxia.logging.Log log)
protected org.apache.maven.doxia.logging.Log
getLog()
Returns a logger for this sink.protected void
init()
This is called inSink.head()
or inSink.close()
, and can be used to set the sink into a clear state so it can be re-used.protected static java.lang.String
unifyEOLs(java.lang.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
address, address, address_, anchor, anchor, anchor_, article, article, article_, author, author, author_, blockquote, blockquote, blockquote_, body, body, body_, bold, bold_, close, comment, content, content, content_, data, data, data_, date, date, date_, definedTerm, definedTerm, definedTerm_, definition, definition, definition_, definitionList, definitionList, definitionList_, definitionListItem, definitionListItem, definitionListItem_, division, division, division_, figure, figure, figure_, figureCaption, figureCaption, figureCaption_, figureGraphics, figureGraphics, flush, footer, footer, footer_, head, head, head_, header, header, header_, horizontalRule, horizontalRule, inline, inline, inline_, italic, italic_, lineBreak, lineBreak, lineBreakOpportunity, lineBreakOpportunity, link, link, link_, list, list, list_, listItem, listItem, listItem_, monospaced, monospaced_, navigation, navigation, navigation_, nonBreakingSpace, numberedList, numberedList, numberedList_, numberedListItem, numberedListItem, numberedListItem_, pageBreak, paragraph, paragraph, paragraph_, rawText, section, section_, section1, section1_, section2, section2_, section3, section3_, section4, section4_, section5, section5_, section6, section6_, sectionTitle, sectionTitle, sectionTitle_, sectionTitle_, sectionTitle1, sectionTitle1_, sectionTitle2, sectionTitle2_, sectionTitle3, sectionTitle3_, sectionTitle4, sectionTitle4_, sectionTitle5, sectionTitle5_, sectionTitle6, sectionTitle6_, sidebar, sidebar, sidebar_, table, table, table_, tableCaption, tableCaption, tableCaption_, tableCell, tableCell, tableCell, tableCell_, tableHeaderCell, tableHeaderCell, tableHeaderCell, tableHeaderCell_, tableRow, tableRow, tableRow_, tableRows, tableRows_, text, text, time, time, time_, title, title, title_, unknown, verbatim, verbatim, verbatim_
-
-
-
-
Method Detail
-
enableLogging
public void enableLogging(org.apache.maven.doxia.logging.Log log)
- Specified by:
enableLogging
in interfaceorg.apache.maven.doxia.logging.LogEnabled
-
getLog
protected org.apache.maven.doxia.logging.Log getLog()
Returns a logger for this sink. If no logger has been configured, a new SystemStreamLog is returned.- Returns:
- Log
-
unifyEOLs
protected static java.lang.String unifyEOLs(java.lang.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 inSink.head()
or inSink.close()
, and can be used to set the sink into a clear state so it can be re-used.- Since:
- 1.1.2
-
-