Package org.apache.juneau.marshall.csv
Class CsvWriter
java.lang.Object
java.io.Writer
org.apache.juneau.marshall.serializer.SerializerWriter<CsvWriter>
org.apache.juneau.marshall.csv.CsvWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
Specialized writer for serializing CSV.
Notes:
- This class is not intended for external use.
-
Field Summary
Fields inherited from class org.apache.juneau.marshall.serializer.SerializerWriter
maxIndent, out, quoteChar, trimStrings, uriResolver, useWhitespace -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCsvWriter(Writer out, boolean useWhitespace, int maxIndent, char quoteChar, boolean trimStrings, UriResolver uriResolver) Constructor. -
Method Summary
-
Constructor Details
-
CsvWriter
protected CsvWriter(Writer out, boolean useWhitespace, int maxIndent, char quoteChar, boolean trimStrings, UriResolver uriResolver) Constructor.- Parameters:
out- The writer being wrapped.useWhitespace- Iftrue , tabs and spaces will be used in output.maxIndent- The maximum indentation level.quoteChar- The quote character to use (i.e.'\'' or'"' )trimStrings- Iftrue , strings will be trimmed before being serialized.uriResolver- The URI resolver for resolving URIs to absolute or root-relative form.
-
-
Method Details
-
writeEntry
Writes an entry to the writer.Follows RFC 4180 quoting rules:
- Values containing commas, double-quote characters, or newlines are enclosed in double quotes.
- Double-quote characters within a quoted field are escaped by preceding them with another double-quote.
- The literal string
nullis written unquoted; the string value"null"is quoted.
- Parameters:
value- The value to write.
Can benull (written as the literal"null" ).
-