public abstract class AbstractTextWriter extends AbstractWriter
CharsetEncoding
Modifier and Type | Field and Description |
---|---|
protected CharsetEncoding |
encodingProps
Container for character encoding related attributes
|
input, options
Modifier | Constructor and Description |
---|---|
protected |
AbstractTextWriter()
Writes text to an empty target with default settings.
|
protected |
AbstractTextWriter(boolean provideDoneSignal)
Writes text to an empty target with default settings,
optionally providing a port for signaling
completion of the write.
|
protected |
AbstractTextWriter(ByteSink target,
WriteMode mode)
Writes text to the specified target sink in the
given mode.
|
protected |
AbstractTextWriter(Path path,
WriteMode mode)
Writes text to the specified path in the given mode,
using default settings.
|
protected |
AbstractTextWriter(String path,
WriteMode mode)
Writes text to the specified path in the given mode,
using default settings.
|
Modifier and Type | Method and Description |
---|---|
Charset |
getCharset()
Gets the character set used by the data sink.
|
String |
getCharsetName()
Gets the name of the character set used by the
data sink.
|
int |
getEncodeBuffer()
Gets the size of the buffer, in bytes, used to encode
character data.
|
CharsetEncoding |
getEncoding()
Get the character set encoding properties.
|
CodingErrorAction |
getErrorAction()
Get the configured encoding error action.
|
String |
getReplacement()
Get the text used by the replacement error action.
|
void |
setCharset(Charset charset)
Sets the character set used by the data sink.
|
void |
setCharsetName(String charsetName)
Sets the character set used by the data sink.
|
void |
setEncodeBuffer(int size)
Sets the size of the buffer, in bytes, used to encode
character data.
|
void |
setEncoding(CharsetEncoding settings)
Set the properties that control character
set encoding.
|
void |
setErrorAction(CodingErrorAction errorAction)
Set the encoding error action.
|
void |
setReplacement(String replacement)
Sets the error policy to be replacement with the specified string.
|
compose, computeFormat, getFormatOptions, getInput, getMode, getSaveMetadata, getTarget, getWriteBuffer, getWriteOnClient, getWriteSingleSink, isIgnoreSortOrder, setFormatOptions, setIgnoreSortOrder, setMode, setSaveMetadata, setTarget, setTarget, setTarget, setWriteBuffer, setWriteOnClient, setWriteSingleSink
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disableParallelism, getInputPorts, getOutputPorts
protected final CharsetEncoding encodingProps
protected AbstractTextWriter()
AbstractWriter.setTarget(ByteSink)
protected AbstractTextWriter(boolean provideDoneSignal)
provideDoneSignal
- indicates whether a
done signal port should be createdAbstractWriter.setTarget(ByteSink)
protected AbstractTextWriter(String path, WriteMode mode)
If the writer is parallelized, this is interpreted as a directory in which each partition will write a fragment of the entire input stream. Otherwise, it is interpreted as the file to write.
path
- the path to which to writemode
- how to handle existing filesprotected AbstractTextWriter(Path path, WriteMode mode)
If the writer is parallelized, this is interpreted as a directory in which each partition will write a fragment of the entire input stream. Otherwise, it is interpreted as the file to write.
path
- the path to which to writemode
- how to handle existing filesprotected AbstractTextWriter(ByteSink target, WriteMode mode)
The writer can only be parallelized if the sink is fragmentable. In this case, each partition will be written as an independent sink. Otherwise, the writer will run non-parallel.
target
- the sink to which to writemode
- how to handle an existing sinkpublic int getEncodeBuffer()
public void setEncodeBuffer(int size)
size
- the encoding buffer size to usepublic CharsetEncoding getEncoding()
public void setEncoding(CharsetEncoding settings)
settings
- character set encoding propertiespublic Charset getCharset()
public void setCharset(Charset charset)
charset
- the character set to usepublic String getCharsetName()
public void setCharsetName(String charsetName)
charsetName
- name of the character setInvalidPropertyValueException
- if the named
character set is not supported.public CodingErrorAction getErrorAction()
public void setErrorAction(CodingErrorAction errorAction)
errorAction
- encoding error actionpublic String getReplacement()
public void setReplacement(String replacement)
replacement
- replacement value to use for encoding errorsCopyright © 2016 Actian Corporation. All rights reserved.