Package org.apache.maven.doxia.sink.impl
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 abstractSinkFactoryfor Text markup syntax.UTF-8is used when no encoding is specified.- Since:
- 1.1
- Author:
- Hervé Boutemy, Benjamin Bentmann
-
-
Field Summary
-
Fields inherited from interface org.apache.maven.doxia.sink.SinkFactory
ROLE
-
-
Constructor Summary
Constructors Constructor Description AbstractTextSinkFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description SinkcreateSink(File outputDir, String outputName)Create aSinkinto a file.SinkcreateSink(File outputDir, String outputName, String encoding)Create aSinkinto a file using a specified encoding.SinkcreateSink(OutputStream out)Create aSinkinto an OutputStream.SinkcreateSink(OutputStream out, String encoding)Create aSinkinto an OutputStream using a specified encoding.protected abstract SinkcreateSink(Writer writer, String encoding)Create a text Sink for a given encoding.
-
-
-
Method Detail
-
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, nevernull.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 aSinkinto a file.- Specified by:
createSinkin interfaceSinkFactory- Parameters:
outputDir- the not-null output dir.outputName- the not-null output name.- Returns:
- a
Sinkinstance with a file as output. - Throws:
IOException- if any.
-
createSink
public Sink createSink(File outputDir, String outputName, String encoding) throws IOException
Create aSinkinto a file using a specified encoding.- Specified by:
createSinkin interfaceSinkFactory- Parameters:
outputDir- the not-null output dir.outputName- the not-null output name.encoding- the output encoding.- Returns:
- a
Sinkinstance with a file as output and using specified encoding. - Throws:
IOException- if any.- See Also:
SinkFactory.createSink(File, String)
-
createSink
public Sink createSink(OutputStream out) throws IOException
Create aSinkinto an OutputStream.- Specified by:
createSinkin interfaceSinkFactory- Parameters:
out- not null OutputStream to write the result.- Returns:
- a
Sinkinstance. - Throws:
IOException- if any.
-
createSink
public Sink createSink(OutputStream out, String encoding) throws IOException
Create aSinkinto an OutputStream using a specified encoding.- Specified by:
createSinkin interfaceSinkFactory- Parameters:
out- not null OutputStream to write the result.encoding- the output encoding.- Returns:
- a
Sinkinstance using specified encoding. - Throws:
IOException- if any.
-
-