Class AbstractSink

java.lang.Object
org.apache.maven.doxia.sink.impl.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
  • Field Details

    • logger

      private Log logger
  • Constructor Details

    • AbstractSink

      public AbstractSink()
  • Method Details

    • 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