Class CsvPipelineOutput
java.lang.Object
com.northconcepts.datapipeline.foundations.core.Bean
com.northconcepts.datapipeline.foundations.core.FoundationObject
com.northconcepts.datapipeline.foundations.pipeline.PipelineObject
com.northconcepts.datapipeline.foundations.pipeline.PipelineOutput
com.northconcepts.datapipeline.foundations.pipeline.output.FileSinkPipelineOutput
com.northconcepts.datapipeline.foundations.pipeline.output.CsvPipelineOutput
- All Implemented Interfaces:
DataExceptionContributor,JsonSerializable,RecordSerializable,XmlSerializable,DataWriterFactory,JavaCodeGenerator,Serializable
- See Also:
-
Field Summary
Fields inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
internalId, internalName, log, TIMESTAMP_FORMATFields inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
SERIALIZED_CLASS_NAME, TYPEFields inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
XML_SERIALIZED_CLASS_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromRecord(Record source) Loads this instance's state from a record and returnsthis(for fluid API call chaining).fromXmlElement(Element pipelineOutputElement) voidAppends Java source code representing this object to the given builder.voidgenerateSaveCode(JavaCodeBuilder javaCodeBuilder) Writes the generated code that saves the output afterJob.run(reader, writer); does nothing by default.Returns the character set used to write the file (defaults to UTF-8); blank uses the platform default.Returns how empty strings are written (defaults toCSVWriter.ValuePolicy.QUOTED_EMPTY_STRING, a pair of quotes).Returns the string that ends a quoted value (defaults to a double quote).Returns the string written between field values (defaults to comma).getName()Returns a display name for this output, such as the destination's name followed by its format.Returns the string written after each record (defaults to the system line separator).Returns the line separator in Java-escaped form, as serialized.Returns how null values are written (defaults toCSVWriter.ValuePolicy.EMPTY_STRING, an unquoted blank).Returns the string that starts a quoted value (defaults to a double quote).booleanIndicates if the file's stream is closed when the writer is closed (defaults to true).booleanIndicates if a header row of field names is written first (defaults to true).booleanIndicates if the output is flushed after each record (defaults to false).booleanIndicates if every non-empty value is quoted, not only those that need it (defaults to false).setAutoCloseWriter(boolean autoCloseWriter) Indicates if the file's stream is closed when the writer is closed (defaults to true).setCharset(String charset) Sets the character set used to write the file (defaults to UTF-8); blank uses the platform default.setEmptyStringValuePolicy(CSVWriter.ValuePolicy emptyStringValuePolicy) Sets how empty strings are written (defaults toCSVWriter.ValuePolicy.QUOTED_EMPTY_STRING, a pair of quotes).setEndingQuote(String endingQuote) Sets the string that ends a quoted value (defaults to a double quote).setFieldNamesInFirstRow(boolean fieldNamesInFirstRow) Indicates if a header row of field names is written first (defaults to true).setFieldSeparator(String fieldSeparator) Sets the string written between field values (defaults to comma).setFileSink(FileSink fileSink) setFlushOnWrite(boolean flushOnWrite) Indicates if the output is flushed after each record (defaults to false).setForceQuote(boolean forceQuote) Indicates if every non-empty value is quoted, not only those that need it (defaults to false).setNewLine(String newLine) Sets the string written after each record (defaults to the system line separator).setNewLineEscaped(String newLine) Sets the line separator from its Java-escaped form, as serialized.setNullValuePolicy(CSVWriter.ValuePolicy nullValuePolicy) Sets how null values are written (defaults toCSVWriter.ValuePolicy.EMPTY_STRING, an unquoted blank).setStartingQuote(String startingQuote) Sets the string that starts a quoted value (defaults to a double quote).toRecord()Converts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.toXmlElement(Document document) Returns an element, created withdocument, describing this object; the default implementation throws aDataException.Methods inherited from class com.northconcepts.datapipeline.foundations.pipeline.PipelineOutput
getNestedPipelineOutput, getPipelineOutput, getRootPipelineOutputMethods inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
addExceptionProperties, assertValid, assertValid, clone, exception, exception, exception, getInternalId, getInternalName, resetInternalIdMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.northconcepts.datapipeline.core.DataExceptionContributor
addExceptionProperties
-
Constructor Details
-
CsvPipelineOutput
public CsvPipelineOutput()
-
-
Method Details
-
getName
Description copied from class:PipelineOutputReturns a display name for this output, such as the destination's name followed by its format.- Overrides:
getNamein classFileSinkPipelineOutput
-
toRecord
Description copied from interface:RecordSerializableConverts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.- Specified by:
toRecordin interfaceRecordSerializable- Overrides:
toRecordin classBean
-
fromRecord
Description copied from interface:RecordSerializableLoads this instance's state from a record and returnsthis(for fluid API call chaining). For fluid API call chaining, the overridden method should change the declared return type to its class.- Specified by:
fromRecordin interfaceRecordSerializable- Overrides:
fromRecordin classPipelineOutput- Parameters:
source-- Returns:
- this instance.
-
getFieldSeparator
Returns the string written between field values (defaults to comma). -
setFieldSeparator
Sets the string written between field values (defaults to comma). -
getStartingQuote
Returns the string that starts a quoted value (defaults to a double quote). -
setStartingQuote
Sets the string that starts a quoted value (defaults to a double quote). -
getEndingQuote
Returns the string that ends a quoted value (defaults to a double quote). -
setEndingQuote
Sets the string that ends a quoted value (defaults to a double quote). -
getNewLine
Returns the string written after each record (defaults to the system line separator). -
setNewLine
Sets the string written after each record (defaults to the system line separator). -
getNewLineEscaped
Returns the line separator in Java-escaped form, as serialized. -
setNewLineEscaped
Sets the line separator from its Java-escaped form, as serialized. -
getNullValuePolicy
Returns how null values are written (defaults toCSVWriter.ValuePolicy.EMPTY_STRING, an unquoted blank). -
setNullValuePolicy
Sets how null values are written (defaults toCSVWriter.ValuePolicy.EMPTY_STRING, an unquoted blank). -
getEmptyStringValuePolicy
Returns how empty strings are written (defaults toCSVWriter.ValuePolicy.QUOTED_EMPTY_STRING, a pair of quotes). -
setEmptyStringValuePolicy
Sets how empty strings are written (defaults toCSVWriter.ValuePolicy.QUOTED_EMPTY_STRING, a pair of quotes). -
isForceQuote
public boolean isForceQuote()Indicates if every non-empty value is quoted, not only those that need it (defaults to false). -
setForceQuote
Indicates if every non-empty value is quoted, not only those that need it (defaults to false). -
isAutoCloseWriter
public boolean isAutoCloseWriter()Indicates if the file's stream is closed when the writer is closed (defaults to true). -
setAutoCloseWriter
Indicates if the file's stream is closed when the writer is closed (defaults to true). -
isFlushOnWrite
public boolean isFlushOnWrite()Indicates if the output is flushed after each record (defaults to false). -
setFlushOnWrite
Indicates if the output is flushed after each record (defaults to false). -
isFieldNamesInFirstRow
public boolean isFieldNamesInFirstRow()Indicates if a header row of field names is written first (defaults to true). -
setFieldNamesInFirstRow
Indicates if a header row of field names is written first (defaults to true). -
createDataWriter
-
getFileSink
- Specified by:
getFileSinkin classFileSinkPipelineOutput
-
setFileSink
- Specified by:
setFileSinkin classFileSinkPipelineOutput
-
generateSaveCode
Description copied from class:FileSinkPipelineOutputWrites the generated code that saves the output afterJob.run(reader, writer); does nothing by default.- Overrides:
generateSaveCodein classFileSinkPipelineOutput
-
generateJavaCode
Description copied from interface:JavaCodeGeneratorAppends Java source code representing this object to the given builder. -
getCharset
Returns the character set used to write the file (defaults to UTF-8); blank uses the platform default. -
setCharset
Sets the character set used to write the file (defaults to UTF-8); blank uses the platform default. -
toXmlElement
Description copied from interface:XmlSerializableReturns an element, created withdocument, describing this object; the default implementation throws aDataException.- Specified by:
toXmlElementin interfaceXmlSerializable- Overrides:
toXmlElementin classPipelineOutput
-
fromXmlElement
-