Package org.apache.juneau.csv
Class CsvWriter
java.lang.Object
java.io.Writer
org.apache.juneau.serializer.SerializerWriter
org.apache.juneau.csv.CsvWriter
- All Implemented Interfaces:
- Closeable,- Flushable,- Appendable,- AutoCloseable
Specialized writer for serializing CSV.
 
Notes:
- This class is not intended for external use.
- 
Field SummaryFields inherited from class org.apache.juneau.serializer.SerializerWritermaxIndent, out, quoteChar, trimStrings, uriResolver, useWhitespace
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCsvWriter(Writer out, boolean useWhitespace, int maxIndent, char quoteChar, boolean trimStrings, UriResolver uriResolver) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionappend(char c) append(int indent, char c) Writes an indent (if theuseWhitespacesetting is enabled), followed by text.Writes an indent (if theuseWhitespacesetting is enabled), followed by text.Writes the specified text to the writer if it isn'tnull .Writes the specified text to the writer if it isn'tnull .appendIf(boolean b, char c) Writes the specified text to the writer if b is true.Writes the specified text to the writer if b is true.Writes an indent (if theuseWhitespacesetting is enabled), followed by text, followed by a newline (if theuseWhitespacesetting is enabled).Writes the specified text followed by a newline (if theuseWhitespacesetting is enabled).i(int indent) Writes an indent to the writer if theuseWhitespacesetting is enabled.nl(int indent) Writes a newline to the writer if theuseWhitespacesetting is enabled.q()Adds the quote character specified by thequoteCharsetting to the output.s()Adds a whitespace character to the output if theuseWhitespacesetting is enabled.voidwriteEntry(Object value) Writes an entry to the writer.
- 
Constructor Details- 
CsvWriterprotected CsvWriter(Writer out, boolean useWhitespace, int maxIndent, char quoteChar, boolean trimStrings, UriResolver uriResolver) Constructor.- Parameters:
- out- The writer being wrapped.
- useWhitespace- If- true , tabs and spaces will be used in output.
- maxIndent- The maximum indentation level.
- quoteChar- The quote character to use (i.e.- '\'' or- '"' )
- trimStrings- If- true , strings will be trimmed before being serialized.
- uriResolver- The URI resolver for resolving URIs to absolute or root-relative form.
 
 
- 
- 
Method Details- 
writeEntryWrites an entry to the writer.- Parameters:
- value- The value to write.
 
- 
appendlnDescription copied from class:SerializerWriterWrites an indent (if theuseWhitespacesetting is enabled), followed by text, followed by a newline (if theuseWhitespacesetting is enabled).- Overrides:
- appendlnin class- SerializerWriter
- Parameters:
- indent- The number of tabs to indent.
- text- The text to write.
- Returns:
- This object.
 
- 
appendlnDescription copied from class:SerializerWriterWrites the specified text followed by a newline (if theuseWhitespacesetting is enabled).- Overrides:
- appendlnin class- SerializerWriter
- Parameters:
- text- The text to write.
- Returns:
- This object.
 
- 
appendDescription copied from class:SerializerWriterWrites an indent (if theuseWhitespacesetting is enabled), followed by text.- Overrides:
- appendin class- SerializerWriter
- Parameters:
- indent- The number of tabs to indent.
- text- The text to write.
- Returns:
- This object.
 
- 
appendDescription copied from class:SerializerWriterWrites an indent (if theuseWhitespacesetting is enabled), followed by text.- Overrides:
- appendin class- SerializerWriter
- Parameters:
- indent- The number of tabs to indent.
- c- The character to write.
- Returns:
- This object.
 
- 
sDescription copied from class:SerializerWriterAdds a whitespace character to the output if theuseWhitespacesetting is enabled.- Overrides:
- sin class- SerializerWriter
- Returns:
- This object.
 
- 
qDescription copied from class:SerializerWriterAdds the quote character specified by thequoteCharsetting to the output.- Overrides:
- qin class- SerializerWriter
- Returns:
- This object.
 
- 
iDescription copied from class:SerializerWriterWrites an indent to the writer if theuseWhitespacesetting is enabled.- Overrides:
- iin class- SerializerWriter
- Parameters:
- indent- The number of tabs to indent.
- Returns:
- This object.
 
- 
nlDescription copied from class:SerializerWriterWrites a newline to the writer if theuseWhitespacesetting is enabled.- Overrides:
- nlin class- SerializerWriter
- Parameters:
- indent- The current indentation level.
- Returns:
- This object.
 
- 
appendDescription copied from class:SerializerWriterWrites the specified text to the writer if it isn'tnull .- Overrides:
- appendin class- SerializerWriter
- Parameters:
- text- The text to write.
- Returns:
- This object.
 
- 
appendDescription copied from class:SerializerWriterWrites the specified text to the writer if it isn'tnull .- Overrides:
- appendin class- SerializerWriter
- Parameters:
- text- The text to write.
- Returns:
- This object.
 
- 
appendIfDescription copied from class:SerializerWriterWrites the specified text to the writer if b is true.- Overrides:
- appendIfin class- SerializerWriter
- Parameters:
- b- Boolean flag.
- text- The text to write.
- Returns:
- This object.
 
- 
appendIfDescription copied from class:SerializerWriterWrites the specified text to the writer if b is true.- Overrides:
- appendIfin class- SerializerWriter
- Parameters:
- b- Boolean flag.
- c- The text to write.
- Returns:
- This object.
 
- 
append- Specified by:
- appendin interface- Appendable
- Overrides:
- appendin class- SerializerWriter
 
 
-