- java.lang.Object
-
- org.refcodes.tabular.CsvRecordWriter<String>
-
- org.refcodes.tabular.CsvStringRecordWriter
-
- All Implemented Interfaces:
AutoCloseable
,org.refcodes.io.RowWriter<String[]>
,org.refcodes.mixin.DelimiterAccessor
,org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<org.refcodes.textual.CsvMixin>
,org.refcodes.mixin.DelimiterAccessor.DelimiterMutator
,org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
,org.refcodes.mixin.TrimAccessor
,org.refcodes.mixin.TrimAccessor.TrimBuilder<org.refcodes.textual.CsvMixin>
,org.refcodes.mixin.TrimAccessor.TrimMutator
,org.refcodes.mixin.TrimAccessor.TrimProperty
,HeaderAccessor<String>
,RecordWriter<String>
,org.refcodes.textual.CsvEscapeModeAccessor
,org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeBuilder<org.refcodes.textual.CsvMixin>
,org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeMutator
,org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeProperty
,org.refcodes.textual.CsvMixin
public class CsvStringRecordWriter extends CsvRecordWriter<String>
- Author:
- steiner
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.textual.CsvEscapeModeAccessor
org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeBuilder<B extends org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeBuilder<?>>, org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeMutator, org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.DelimiterAccessor
org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
-
Nested classes/interfaces inherited from interface org.refcodes.tabular.HeaderAccessor
HeaderAccessor.HeaderBuilder<T extends HeaderAccessor.HeaderBuilder<?>>, HeaderAccessor.HeaderMutator<T>, HeaderAccessor.HeaderProperty<T>
-
-
Field Summary
-
Fields inherited from class org.refcodes.tabular.CsvRecordWriter
_csvBuilder, _header, _outputStream
-
-
Constructor Summary
Constructors Constructor Description CsvStringRecordWriter(File aFile)
CsvStringRecordWriter(File aFile, char aCsvDelimiter)
CsvStringRecordWriter(File aFile, char aCsvDelimiter, String... aHeader)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(File aFile, String... aHeader)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(File aFile, Charset aEncoding)
CsvStringRecordWriter(File aFile, Charset aEncoding, char aCsvDelimiter)
CsvStringRecordWriter(File aFile, Charset aEncoding, char aCsvDelimiter, String... aHeader)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(File aFile, Charset aEncoding, String... aHeader)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(OutputStream aOutputStream)
CsvStringRecordWriter(OutputStream aOutputStream, char aCsvDelimiter)
CsvStringRecordWriter(OutputStream aOutputStream, char aCsvDelimiter, String... aHeader)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(OutputStream aOutputStream, String... aHeader)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(OutputStream aOutputStream, Charset aEncoding)
CsvStringRecordWriter(OutputStream aOutputStream, Charset aEncoding, char aCsvDelimiter)
CsvStringRecordWriter(OutputStream aOutputStream, Charset aEncoding, char aCsvDelimiter, String... aHeader)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(OutputStream aOutputStream, Charset aEncoding, String... aHeader)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(PrintStream aPrintStream)
CsvStringRecordWriter(PrintStream aPrintStream, char aCsvDelimiter)
CsvStringRecordWriter(PrintStream aPrintStream, char aCsvDelimiter, String... aHeader)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(PrintStream aPrintStream, String... aHeader)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(String[] aHeader, File aFile)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(String[] aHeader, File aFile, char aCsvDelimiter)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(String[] aHeader, File aFile, Charset aEncoding)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(String[] aHeader, File aFile, Charset aEncoding, char aCsvDelimiter)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(String[] aHeader, OutputStream aOutputStream)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(String[] aHeader, OutputStream aOutputStream, char aCsvDelimiter)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(String[] aHeader, OutputStream aOutputStream, Charset aEncoding)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(String[] aHeader, OutputStream aOutputStream, Charset aEncoding, char aCsvDelimiter)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(String[] aHeader, PrintStream aPrintStream)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(String[] aHeader, PrintStream aPrintStream, char aCsvDelimiter)
Constructs aCsvRecordWriter
with the given header for logging.CsvStringRecordWriter(Header<String> aHeader, File aFile)
CsvStringRecordWriter(Header<String> aHeader, File aFile, char aCsvDelimiter)
CsvStringRecordWriter(Header<String> aHeader, File aFile, Charset aEncoding)
CsvStringRecordWriter(Header<String> aHeader, File aFile, Charset aEncoding, char aCsvDelimiter)
CsvStringRecordWriter(Header<String> aHeader, OutputStream aOutputStream)
CsvStringRecordWriter(Header<String> aHeader, OutputStream aOutputStream, char aCsvDelimiter)
CsvStringRecordWriter(Header<String> aHeader, OutputStream aOutputStream, Charset aEncoding)
CsvStringRecordWriter(Header<String> aHeader, OutputStream aOutputStream, Charset aEncoding, char aCsvDelimiter)
CsvStringRecordWriter(Header<String> aHeader, PrintStream aPrintStream)
CsvStringRecordWriter(Header<String> aHeader, PrintStream aPrintStream, char aCsvDelimiter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CsvStringRecordWriter
withCommentPrefixes(String... aCommentPrefixes)
CsvStringRecordWriter
withCsvEscapeMode(org.refcodes.textual.CsvEscapeMode aCsvEscapeMode)
CsvStringRecordWriter
withDelimiter(char aCsvDelimiter)
CsvStringRecordWriter
withTrim(boolean isTrimRecords)
-
Methods inherited from class org.refcodes.tabular.CsvRecordWriter
clearCommentPrefixes, close, getCommentPrefixes, getCsvEscapeMode, getDelimiter, getHeader, isTrim, parseHeader, setCommentPrefixes, setCsvEscapeMode, setDelimiter, setTrim, writeComment, writeHeader, writeHeader, writeHeader, writeHeaderComment, writeHeaderComment, writeHeaderComment, writeNext, writeNext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeProperty
letCsvEscapeMode
-
Methods inherited from interface org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
letDelimiter
-
Methods inherited from interface org.refcodes.tabular.RecordWriter
writeNextLine, writeNextType
-
-
-
-
Constructor Detail
-
CsvStringRecordWriter
public CsvStringRecordWriter(String[] aHeader, PrintStream aPrintStream, char aCsvDelimiter)
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aHeader
- TheString
elements representing the header used for logging in the correct format.aPrintStream
- ThePrintStream
to be used for printing output.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.
-
CsvStringRecordWriter
public CsvStringRecordWriter(String[] aHeader, File aFile, char aCsvDelimiter) throws FileNotFoundException
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aHeader
- TheString
elements representing the header used for logging in the correct format.aFile
- theFile
to which to write.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.- Throws:
FileNotFoundException
- If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while
-
CsvStringRecordWriter
public CsvStringRecordWriter(String[] aHeader, File aFile, Charset aEncoding, char aCsvDelimiter) throws IOException
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aHeader
- TheString
elements representing the header used for logging in the correct format.aFile
- theFile
to which to write.aEncoding
- TheCharset
for the character encoding to use.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.- Throws:
IOException
- in case the file is not found or the encoding is not supported.
-
CsvStringRecordWriter
public CsvStringRecordWriter(String[] aHeader, File aFile, Charset aEncoding) throws IOException
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aHeader
- TheString
elements representing the header used for logging in the correct format.aFile
- theFile
to which to write.aEncoding
- TheCharset
for the character encoding to use.- Throws:
IOException
- in case the file is not found or the encoding is not supported.
-
CsvStringRecordWriter
public CsvStringRecordWriter(String[] aHeader, File aFile) throws FileNotFoundException
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aHeader
- TheString
elements representing the header used for logging in the correct format.aFile
- theFile
to which to write.- Throws:
FileNotFoundException
- If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file.
-
CsvStringRecordWriter
public CsvStringRecordWriter(String[] aHeader, OutputStream aOutputStream, char aCsvDelimiter)
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aHeader
- TheString
elements representing the header used for logging in the correct format.aOutputStream
- TheOutputStream
where to write to.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.
-
CsvStringRecordWriter
public CsvStringRecordWriter(String[] aHeader, OutputStream aOutputStream, Charset aEncoding, char aCsvDelimiter) throws UnsupportedEncodingException
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aHeader
- TheString
elements representing the header used for logging in the correct format.aOutputStream
- TheOutputStream
where to write to.aEncoding
- TheCharset
for the character encoding to use.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.- Throws:
UnsupportedEncodingException
- thrown in case an unsupported encoding (Charset
) has been provided.
-
CsvStringRecordWriter
public CsvStringRecordWriter(String[] aHeader, OutputStream aOutputStream, Charset aEncoding) throws UnsupportedEncodingException
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aHeader
- TheString
elements representing the header used for logging in the correct format.aOutputStream
- TheOutputStream
where to write to.aEncoding
- TheCharset
for the character encoding to use.- Throws:
UnsupportedEncodingException
- thrown in case an unsupported encoding (Charset
) has been provided.
-
CsvStringRecordWriter
public CsvStringRecordWriter(String[] aHeader, OutputStream aOutputStream)
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aHeader
- TheString
elements representing the header used for logging in the correct format.aOutputStream
- TheOutputStream
where to write to.
-
CsvStringRecordWriter
public CsvStringRecordWriter(String[] aHeader, PrintStream aPrintStream)
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aHeader
- TheString
elements representing the header used for logging in the correct format.aPrintStream
- ThePrintStream
to be used for printing.
-
CsvStringRecordWriter
public CsvStringRecordWriter(PrintStream aPrintStream, char aCsvDelimiter, String... aHeader)
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aPrintStream
- ThePrintStream
to be used for printing output.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.aHeader
- TheString
elements representing the header used for logging in the correct format.
-
CsvStringRecordWriter
public CsvStringRecordWriter(File aFile, char aCsvDelimiter, String... aHeader) throws FileNotFoundException
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aFile
- theFile
to which to write.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.aHeader
- TheString
elements representing the header used for logging in the correct format.- Throws:
FileNotFoundException
- If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while
-
CsvStringRecordWriter
public CsvStringRecordWriter(File aFile, Charset aEncoding, char aCsvDelimiter, String... aHeader) throws IOException
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aFile
- theFile
to which to write.aEncoding
- TheCharset
for the character encoding to use.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.aHeader
- TheString
elements representing the header used for logging in the correct format.- Throws:
IOException
- in case the file is not found or the encoding is not supported.
-
CsvStringRecordWriter
public CsvStringRecordWriter(File aFile, Charset aEncoding, String... aHeader) throws IOException
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aFile
- theFile
to which to write.aEncoding
- TheCharset
for the character encoding to use.aHeader
- TheString
elements representing the header used for logging in the correct format.- Throws:
IOException
- in case the file is not found or the encoding is not supported.
-
CsvStringRecordWriter
public CsvStringRecordWriter(File aFile, String... aHeader) throws FileNotFoundException
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aFile
- theFile
to which to write.aHeader
- TheString
elements representing the header used for logging in the correct format.- Throws:
FileNotFoundException
- If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file.
-
CsvStringRecordWriter
public CsvStringRecordWriter(OutputStream aOutputStream, char aCsvDelimiter, String... aHeader)
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aOutputStream
- TheOutputStream
where to write to.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.aHeader
- TheString
elements representing the header used for logging in the correct format.
-
CsvStringRecordWriter
public CsvStringRecordWriter(OutputStream aOutputStream, Charset aEncoding, char aCsvDelimiter, String... aHeader) throws UnsupportedEncodingException
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aOutputStream
- TheOutputStream
where to write to.aEncoding
- TheCharset
for the character encoding to use.aCsvDelimiter
- The separator to be used when separating the CSV values in the log output.aHeader
- TheString
elements representing the header used for logging in the correct format.- Throws:
UnsupportedEncodingException
- thrown in case an unsupported encoding (Charset
) has been provided.
-
CsvStringRecordWriter
public CsvStringRecordWriter(OutputStream aOutputStream, Charset aEncoding, String... aHeader) throws UnsupportedEncodingException
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aOutputStream
- TheOutputStream
where to write to.aEncoding
- TheCharset
for the character encoding to use.aHeader
- TheString
elements representing the header used for logging in the correct format.- Throws:
UnsupportedEncodingException
- thrown in case an unsupported encoding (Charset
) has been provided.
-
CsvStringRecordWriter
public CsvStringRecordWriter(OutputStream aOutputStream, String... aHeader)
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aOutputStream
- TheOutputStream
where to write to.aHeader
- TheString
elements representing the header used for logging in the correct format.
-
CsvStringRecordWriter
public CsvStringRecordWriter(PrintStream aPrintStream, String... aHeader)
Constructs aCsvRecordWriter
with the given header for logging.- Parameters:
aPrintStream
- ThePrintStream
to be used for printing.aHeader
- TheString
elements representing the header used for logging in the correct format.
-
CsvStringRecordWriter
public CsvStringRecordWriter(File aFile, char aCsvDelimiter) throws FileNotFoundException
- Throws:
FileNotFoundException
-
CsvStringRecordWriter
public CsvStringRecordWriter(File aFile, Charset aEncoding, char aCsvDelimiter) throws IOException
- Throws:
IOException
-
CsvStringRecordWriter
public CsvStringRecordWriter(File aFile, Charset aEncoding) throws IOException
- Throws:
IOException
-
CsvStringRecordWriter
public CsvStringRecordWriter(File aFile) throws FileNotFoundException
- Throws:
FileNotFoundException
-
CsvStringRecordWriter
public CsvStringRecordWriter(OutputStream aOutputStream, char aCsvDelimiter)
-
CsvStringRecordWriter
public CsvStringRecordWriter(OutputStream aOutputStream, Charset aEncoding, char aCsvDelimiter) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
CsvStringRecordWriter
public CsvStringRecordWriter(OutputStream aOutputStream, Charset aEncoding) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
CsvStringRecordWriter
public CsvStringRecordWriter(OutputStream aOutputStream)
-
CsvStringRecordWriter
public CsvStringRecordWriter(PrintStream aPrintStream, char aCsvDelimiter)
-
CsvStringRecordWriter
public CsvStringRecordWriter(PrintStream aPrintStream)
-
CsvStringRecordWriter
public CsvStringRecordWriter(Header<String> aHeader, PrintStream aPrintStream, char aCsvDelimiter)
-
CsvStringRecordWriter
public CsvStringRecordWriter(Header<String> aHeader, File aFile, char aCsvDelimiter) throws FileNotFoundException
- Throws:
FileNotFoundException
-
CsvStringRecordWriter
public CsvStringRecordWriter(Header<String> aHeader, File aFile, Charset aEncoding, char aCsvDelimiter) throws IOException
- Throws:
IOException
-
CsvStringRecordWriter
public CsvStringRecordWriter(Header<String> aHeader, File aFile, Charset aEncoding) throws IOException
- Throws:
IOException
-
CsvStringRecordWriter
public CsvStringRecordWriter(Header<String> aHeader, File aFile) throws FileNotFoundException
- Throws:
FileNotFoundException
-
CsvStringRecordWriter
public CsvStringRecordWriter(Header<String> aHeader, OutputStream aOutputStream, char aCsvDelimiter)
-
CsvStringRecordWriter
public CsvStringRecordWriter(Header<String> aHeader, OutputStream aOutputStream, Charset aEncoding, char aCsvDelimiter) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
CsvStringRecordWriter
public CsvStringRecordWriter(Header<String> aHeader, OutputStream aOutputStream, Charset aEncoding) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
CsvStringRecordWriter
public CsvStringRecordWriter(Header<String> aHeader, OutputStream aOutputStream)
-
CsvStringRecordWriter
public CsvStringRecordWriter(Header<String> aHeader, PrintStream aPrintStream)
-
-
Method Detail
-
withTrim
public CsvStringRecordWriter withTrim(boolean isTrimRecords)
- Specified by:
withTrim
in interfaceorg.refcodes.mixin.TrimAccessor.TrimBuilder<org.refcodes.textual.CsvMixin>
- Overrides:
withTrim
in classCsvRecordWriter<String>
-
withCsvEscapeMode
public CsvStringRecordWriter withCsvEscapeMode(org.refcodes.textual.CsvEscapeMode aCsvEscapeMode)
- Specified by:
withCsvEscapeMode
in interfaceorg.refcodes.textual.CsvEscapeModeAccessor.CsvEscapeModeBuilder<org.refcodes.textual.CsvMixin>
- Overrides:
withCsvEscapeMode
in classCsvRecordWriter<String>
-
withDelimiter
public CsvStringRecordWriter withDelimiter(char aCsvDelimiter)
- Specified by:
withDelimiter
in interfaceorg.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<org.refcodes.textual.CsvMixin>
- Overrides:
withDelimiter
in classCsvRecordWriter<String>
-
withCommentPrefixes
public CsvStringRecordWriter withCommentPrefixes(String... aCommentPrefixes)
- Specified by:
withCommentPrefixes
in interfaceorg.refcodes.textual.CsvMixin
- Overrides:
withCommentPrefixes
in classCsvRecordWriter<String>
-
-