Class AbstractTextSinkFactory

java.lang.Object
org.apache.maven.doxia.sink.impl.AbstractTextSinkFactory
All Implemented Interfaces:
SinkFactory
Direct Known Subclasses:
AbstractXmlSinkFactory, AptSinkFactory, ConfluenceSinkFactory, LatexSinkFactory, TWikiSinkFactory

public abstract class AbstractTextSinkFactory extends Object implements SinkFactory
An abstract SinkFactory for Text markup syntax. UTF-8 is used when no encoding is specified.
Since:
1.1
  • Constructor Details

    • AbstractTextSinkFactory

      public AbstractTextSinkFactory()
  • Method Details

    • createSink

      protected abstract Sink createSink(Writer writer, String encoding)
      Create a text Sink for a given encoding.
      Parameters:
      writer - The writer for the sink output, never null.
      encoding - The character encoding used by the writer.
      Returns:
      a Sink for text output in the given encoding.
    • createSink

      public Sink createSink(File outputDir, String outputName) throws IOException
      Create a Sink into a file.
      Specified by:
      createSink in interface SinkFactory
      Parameters:
      outputDir - the not-null output dir.
      outputName - the not-null output name.
      Returns:
      a Sink instance with a file as output.
      Throws:
      IOException - if any.
    • createSink

      public Sink createSink(File outputDir, String outputName, String encoding) throws IOException
      Create a Sink into a file using a specified encoding.
      Specified by:
      createSink in interface SinkFactory
      Parameters:
      outputDir - the not-null output dir.
      outputName - the not-null output name.
      encoding - the output encoding.
      Returns:
      a Sink instance with a file as output and using specified encoding.
      Throws:
      IOException - if any.
      See Also:
    • createSink

      public Sink createSink(OutputStream out) throws IOException
      Create a Sink into an OutputStream.
      Specified by:
      createSink in interface SinkFactory
      Parameters:
      out - not null OutputStream to write the result.
      Returns:
      a Sink instance.
      Throws:
      IOException - if any.
    • createSink

      public Sink createSink(OutputStream out, String encoding) throws IOException
      Create a Sink into an OutputStream using a specified encoding.
      Specified by:
      createSink in interface SinkFactory
      Parameters:
      out - not null OutputStream to write the result.
      encoding - the output encoding.
      Returns:
      a Sink instance using specified encoding.
      Throws:
      IOException - if any.