| Modifier and Type | Class and Description |
|---|---|
| public static enum | CsvGenerator.
Enumeration that defines all togglable features for CSV writers (if any: currently none) |
| Modifier and Type | Field and Description |
|---|---|
| protected StringBuilder | _arrayContents
Accumulated contents of an array cell, if any |
| protected int | _arrayElements
Additional counter that indicates number of value entries in the array. |
| protected String | _arraySeparator
Separator to use during writing of (simple) array value, to be encoded as a single column value, if any. |
| protected CharacterEscapes | |
| protected int | _formatFeatures
Bit flag composed of bits that indicate which
|
| protected boolean | _handleFirstLine
Flag that indicates that we need to write header line, if one is needed. |
| protected int | _nextColumnByName
Index of column that we will be getting next, based on field name call that was made. |
| protected CsvValueDecorator | _nextColumnDecorator
Decorator to use for decorating the column value to follow, if any;
|
| protected CsvSchema | _schema
Definition of columns being written, if available. |
| protected boolean | _skipValue
Flag set when property to write is unknown, and the matching value is to be skipped quietly. |
| protected SimpleTokenWriteContext | _skipWithin
When skipping output (for "unknown" output), outermost write context where skipping should occur |
| protected final StreamWriteConstraints | |
| protected SimpleTokenWriteContext | _tokenWriteContext
Current context, in form we can use it (GeneratorBase has untyped reference; left as null) |
| protected CsvEncoder | |
| private static final CsvSchema | |
| protected static final long | |
| protected static final long |
| Access | Constructor and Description |
|---|---|
| public | CsvGenerator(IOContext ctxt, int jsonFeatures, int csvFeatures, ObjectCodec codec, Writer out, CsvSchema schema)
|
| public | CsvGenerator(IOContext ctxt, int jsonFeatures, int csvFeatures, ObjectCodec codec, CsvEncoder csvWriter)
|
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected void | |
| protected final int | |
| protected void | |
| protected void | _releaseBuffers()
Implements abstract com. Method called to release any buffers generator may be holding, once generator is being closed. |
| protected void | _reportMappingError(String msg)
Method called when there is a problem related to mapping data (compared to a low-level generation); if so, should be surfaced as |
| protected final void | _verifyValueWrite(String
Additional message used for generating exception message
if value output is NOT legal in current generator output state. typeMsg)Implements abstract com. Method called before trying to write a value (scalar or structured), to verify that this is legal in current output state, as well as to output separators if and as necessary. |
| private final void | |
| public boolean | canOmitFields()
Overrides com. Introspection method to call to check whether it is ok to omit writing of Object fields or not. |
| public boolean | canUseSchema(FormatSchema
Schema to check schema)Overrides com. Method that can be used to verify that given schema can be used with
this generator (using |
| public boolean | canWriteFormattedNumbers()
Overrides com. Introspection method to call to check whether it is possible
to write numbers using |
| public void | close()
Overrides com. Implements java. Method called to close this generator, so that no more content can be written. |
| public CsvGenerator | |
| public CsvGenerator | |
| public CsvGenerator | |
| protected void | finishRow()
Method called when the current row is complete; typically will flush possibly buffered column values, append linefeed and reset state appropriately. |
| public final void | flush()
Implements abstract com. Implements java. Method called to flush any buffered content to the underlying target (output stream, writer), and to flush the target itself as well. |
| public CharacterEscapes | getCharacterEscapes()
Overrides com. Method for accessing custom escapes factory uses for |
| public int | getFormatFeatures()
Overrides com. Bulk access method for getting state of all |
| public int | getOutputBuffered()
Overrides com. Note while this method will return some information on amount of data buffered, it may be an incomplete view as some buffering happens at a higher level, as not-yet-serialized values. |
| public SimpleTokenWriteContext | getOutputContext()
Overrides com. Note type was co-variant until Jackson 2.7; reverted back to base type in 2.8 to allow for overriding by subtypes that use custom context type. |
| public Object | getOutputTarget()
Overrides com. Method that can be used to get access to object that is used
as target for generated output; this is usually either
|
| public JacksonFeatureSet | getWriteCapabilities()
Overrides com. Accessor for getting metadata on capabilities of this generator, based on underlying data format being read (directly or indirectly). |
| public final boolean | |
| public JsonGenerator | overrideFormatFeatures(int
Bit mask of set/clear state for features to change values, int Bit mask of features to change mask)Overrides com. Bulk set method for (re)setting states of |
| public JsonGenerator | setCharacterEscapes(CharacterEscapes
CharacterEscapes to configure this generator to use, if any; null if noneOverrides com. Method for defining custom escapes factory uses for |
| public CsvGenerator | setPrettyPrinter(PrettyPrinter
PrettyPrinter to assign, if any; null if noneOverrides com. No way (or need) to indent anything, so let's block any attempts. |
| public void | setSchema(FormatSchema
Schema to use schema)Overrides com. Method to call to make this generator use specified schema. |
| public StreamWriteConstraints | streamWriteConstraints()
Overrides com. Get the constraints to apply when performing streaming writes. |
| public CsvGenerator | useDefaultPrettyPrinter()
Overrides com. No way (or need) to indent anything, so let's block any attempts. |
| public Version | version()
Overrides com. Implements com. Implemented with standard version number detection algorithm, typically using a simple generated class, with information extracted from Maven project file during build. |
| public void | writeBinary(Base64Variant
Base64 variant to use: defines details such as
whether padding is used (and if so, using which character);
what is the maximum line length before adding linefeed,
and also the underlying alphabet to use. b64variant, byte[] Buffer that contains binary data to write data, int Offset in offset, int data of the first byte of data to writeLength of data to write len)Implements abstract com. Method that will output given chunk of binary data as base64 encoded, as a complete String value (surrounded by double quotes). |
| public void | writeBoolean(boolean
Boolean value to write state)Implements abstract com. Method for outputting literal JSON boolean value (one of Strings 'true' and 'false'). |
| public final void | writeEndArray()
Implements abstract com. Method for writing closing marker of a JSON Array value (character ']'; plus possible white space decoration if pretty-printing is enabled). |
| public final void | writeEndObject()
Implements abstract com. Method for writing closing marker of an Object value (character '}'; plus possible white space decoration if pretty-printing is enabled). |
| public final void | writeFieldName(String
Field name to write name)Implements abstract com. Method for writing a field name (JSON String surrounded by double quotes: syntactically identical to a JSON String value), possibly decorated by white space if pretty-printing is enabled. |
| public final void | writeFieldName(SerializableString
Field name to write name)Overrides com. Method similar to |
| public void | writeNull()
Implements abstract com. Method for outputting literal JSON null value. |
| public void | writeNumber(int
Number value to write v)Implements abstract com. Method for outputting given value as JSON number. |
| public void | writeNumber(long
Number value to write v)Implements abstract com. Method for outputting given value as JSON number. |
| public void | writeNumber(BigInteger
Number value to write v)Implements abstract com. Method for outputting given value as JSON number. |
| public void | writeNumber(double
Number value to write v)Implements abstract com. Method for outputting indicate JSON numeric value. |
| public void | writeNumber(float
Number value to write v)Implements abstract com. Method for outputting indicate JSON numeric value. |
| public void | writeNumber(BigDecimal
Number value to write v)Implements abstract com. Method for outputting indicate JSON numeric value. |
| public void | writeNumber(String
Textual (possibly formatted) number representation to write encodedValue)Implements abstract com. Write method that can be used for custom numeric types that can not be (easily?) converted to "standard" Java number types. |
| public void | writeOmittedField(String
Name of the field omitted fieldName)Overrides com. Method called to indicate that a property in this position was skipped. |
| public void | writeRaw(String
Textual contents to include as-is in output. text)Implements abstract com. Method that will force generator to copy input text verbatim with no modifications (including that no escaping is done and no separators are added even if context [array, object] would otherwise require such). |
| public void | writeRaw(String
String that has contents to include as-is in output text, int Offset within offset, int text of the first character to outputLength of content (from len)text, starting at offset offset) to outputImplements abstract com. Method that will force generator to copy input text verbatim with no modifications (including that no escaping is done and no separators are added even if context [array, object] would otherwise require such). |
| public void | writeRaw(char[]
Buffer that has contents to include as-is in output text, int Offset within offset, int text of the first character to outputLength of content (from len)text, starting at offset offset) to outputImplements abstract com. Method that will force generator to copy input text verbatim with no modifications (including that no escaping is done and no separators are added even if context [array, object] would otherwise require such). |
| public void | writeRaw(char
Character to included in output c)Implements abstract com. Method that will force generator to copy input text verbatim with no modifications (including that no escaping is done and no separators are added even if context [array, object] would otherwise require such). |
| public void | writeRawUTF8String(byte[]
Buffer that contains String value to write text, int Offset in offset, int buffer of the first byte of String value to writeLength of the String value (in characters) to write len)Implements abstract com. Method similar to |
| public void | writeRawValue(String
Textual contents to included in output text)Overrides com. Method that will force generator to copy input text verbatim without any modifications, but assuming it must constitute a single legal JSON value (number, string, boolean, null, Array or List). |
| public void | writeRawValue(String text, int offset, int len)
Overrides com.
|
| public void | writeRawValue(char[] text, int offset, int len)
Overrides com.
|
| public final void | writeStartArray()
Implements abstract com. Method for writing starting marker of a Array value (for JSON this is character '['; plus possible white space decoration if pretty-printing is enabled). |
| public final void | writeStartObject()
Implements abstract com. Method for writing starting marker of an Object value (character '{'; plus possible white space decoration if pretty-printing is enabled). |
| public void | writeString(String
Text value to write text)Implements abstract com. Method for outputting a String value. |
| public void | writeString(char[]
Buffer that contains String value to write text, int Offset in offset, int buffer of the first character of String value to writeLength of the String value (in characters) to write len)Implements abstract com. Method for outputting a String value. |
| public final void | writeString(SerializableString
Pre-encoded String value to write sstr)Overrides com. Method similar to |
| public void | writeUTF8String(byte[]
Buffer that contains String value to write text, int Offset in offset, int buffer of the first byte of String value to writeLength of the String value (in characters) to write len)Implements abstract com. Method similar to |