| Modifier and Type | Field and Description |
|---|---|
| protected boolean | _cfgNumbersAsStrings
Flag set to indicate that implicit conversion from number
to JSON String is needed (as per
|
| protected boolean | _closed
Flag that indicates whether generator is closed or not. |
| protected int | _features
Bit flag composed of bits that indicate which
|
| protected final IOContext | |
| protected ObjectCodec | |
| protected JsonWriteContext | _writeContext
Object that keeps track of the current contextual state of the generator. |
| protected static final int | DERIVED_FEATURES_MASK
Set of feature masks related to features that need updates of other local configuration or state. |
| protected static final int | MAX_BIG_DECIMAL_SCALE
This value is the limit of scale allowed for serializing |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| protected static final String | |
| protected static final String | |
| protected static final String | |
| protected static final String | |
| protected static final String | |
| protected static final String |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | |
| protected | |
| protected | GeneratorBase(int features, ObjectCodec codec, IOContext ioContext, JsonWriteContext jsonWriteContext)
|
| Modifier and Type | Method and Description |
|---|---|
| protected String | Returns: String representation ofvalueBigDecimal value to convert to String value)Helper method used to serialize a |
| protected void | |
| protected void | |
| protected void | |
| protected void | _checkStdFeatureChanges(int
Bitflag of standard features after they were changed newFeatureFlags, int Bitflag of standard features for which setting
did change changedFeatures)Helper method called to verify changes to standard features. |
| protected PrettyPrinter | Returns: Instance of "default" pretty printer to useOverridable factory method called to instantiate an appropriate |
| protected final int | |
| protected abstract void | _releaseBuffers()
Method called to release any buffers generator may be holding, once generator is being closed. |
| protected abstract void | _verifyValueWrite(String
Additional message used for generating exception message
if value output is NOT legal in current generator output state. typeMsg)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. |
| public void | assignCurrentValue(Object
Current value to assign for the current context of this generator v)Overrides com. Helper method, usually equivalent to:
|
| public void | close()
Implements abstract com. Implements java. Method called to close this generator, so that no more content can be written. |
| public Object | currentValue()
Overrides com. Helper method, usually equivalent to:
Note that "current value" is NOT populated (or used) by Streaming parser or generators; it is only used by higher-level data-binding functionality. |
| public JsonGenerator | disable(JsonGenerator.
Feature to disable fImplements abstract com. Method for disabling specified feature
(check |
| public JsonGenerator | enable(JsonGenerator.
Feature to enable fImplements abstract com. Method for enabling specified generator feature:
check |
| public abstract void | flush()
Redeclares java. Implements abstract com. Method called to flush any buffered content to the underlying target (output stream, writer), and to flush the target itself as well. |
| public ObjectCodec | getCodec()
Implements abstract com. Method for accessing the object used for writing Java
object as JSON content
(using method |
| public int | getFeatureMask()
Implements abstract com. Bulk access method for getting state of all standard (non-dataformat-specific)
|
| public JsonStreamContext | getOutputContext()
Implements abstract 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 IOContext | |
| public boolean | isClosed()
Implements abstract com. Method that can be called to determine whether this generator is closed or not. |
| public final boolean | isEnabled(JsonGenerator.
Feature to check fImplements abstract com. Method for checking whether given feature is enabled. |
| public JsonGenerator | overrideStdFeatures(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 features specified by |
| public JsonGenerator | setCodec(ObjectCodec
Codec to assign, if any; oc)null if noneImplements abstract com. Method that can be called to set or reset the object to
use for writing Java objects as JsonContent
(using method |
| public JsonGenerator | setFeatureMask(int
Bitmask that defines which newMask)Features are enabled
and which disabledImplements abstract com.
Deprecated
Bulk set method for (re)setting states of all standard |
| public JsonGenerator | useDefaultPrettyPrinter()
Implements abstract com. Convenience method for enabling pretty-printing using
the default pretty printer
( |
| public Version | Returns: Version number of the generator (version of the jar that contains generator implementation class)Implements abstract 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 int | writeBinary(Base64Variant
Base64 variant to use b64variant, InputStream InputStream to use for reading binary data to write.
Will not be closed after successful write operation data, int (optional) number of bytes that will be available;
or -1 to be indicate it is not known.
If a positive length is given, dataLength)data MUST provide at least
that many bytes: if not, an exception will be thrown.
Note that implementations
need not support cases where length is not known in advance; this
depends on underlying data format: JSON output does NOT require length,
other formats may.Implements abstract com. Method similar to |
| public void | writeFieldName(SerializableString
Field name to write name)Implements abstract com. Method similar to |
| public void | writeObject(Object
Java value (usually POJO) to write value)Implements abstract com. Older alias for |
| public void | writeRawValue(String
Textual contents to included in output text)Implements abstract 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)
Implements abstract com.
|
| public void | writeRawValue(char[] text, int offset, int len)
Implements abstract com.
|
| public void | writeRawValue(SerializableString
Pre-encoded textual contents to included in output text)Overrides com. Method similar to |
| public void | writeStartObject(Object
"Current value" to assign for the Object context being created forValue)Overrides com. Method for writing starting marker of an Object value to represent the given Java Object value. |
| public void | writeString(SerializableString
Pre-encoded String value to write text)Implements abstract com. Method similar to |
| public void | writeTree(TreeNode
TreeNode to writeImplements abstract com. Method for writing given JSON tree (expressed as a tree where given JsonNode is the root) using this generator. |
| _cfgNumbersAsStrings | back to summary |
|---|---|
| protected boolean _cfgNumbersAsStrings Flag set to indicate that implicit conversion from number
to JSON String is needed (as per
| |
| _closed | back to summary |
|---|---|
| protected boolean _closed Flag that indicates whether generator is closed or not. Gets
set when it is closed by an explicit call
( | |
| _features | back to summary |
|---|---|
| protected int _features Bit flag composed of bits that indicate which
| |
| _ioContext | back to summary |
|---|---|
| protected final IOContext _ioContext | |
| _objectCodec | back to summary |
|---|---|
| protected ObjectCodec _objectCodec | |
| _writeContext | back to summary |
|---|---|
| protected JsonWriteContext _writeContext Object that keeps track of the current contextual state of the generator. | |
| DERIVED_FEATURES_MASK | back to summary |
|---|---|
| protected static final int DERIVED_FEATURES_MASK Set of feature masks related to features that need updates of other local configuration or state.
| |
| MAX_BIG_DECIMAL_SCALE | back to summary |
|---|---|
| protected static final int MAX_BIG_DECIMAL_SCALE This value is the limit of scale allowed for serializing
| |
| SURR1_FIRST | back to summary |
|---|---|
| public static final int SURR1_FIRST | |
| SURR1_LAST | back to summary |
|---|---|
| public static final int SURR1_LAST | |
| SURR2_FIRST | back to summary |
|---|---|
| public static final int SURR2_FIRST | |
| SURR2_LAST | back to summary |
|---|---|
| public static final int SURR2_LAST | |
| WRITE_BINARY | back to summary |
|---|---|
| protected static final String WRITE_BINARY | |
| WRITE_BOOLEAN | back to summary |
|---|---|
| protected static final String WRITE_BOOLEAN | |
| WRITE_NULL | back to summary |
|---|---|
| protected static final String WRITE_NULL | |
| WRITE_NUMBER | back to summary |
|---|---|
| protected static final String WRITE_NUMBER | |
| WRITE_RAW | back to summary |
|---|---|
| protected static final String WRITE_RAW | |
| WRITE_STRING | back to summary |
|---|---|
| protected static final String WRITE_STRING | |
| GeneratorBase | back to summary |
|---|---|
| protected GeneratorBase(int features, ObjectCodec codec)
Deprecated
| |
| GeneratorBase | back to summary |
|---|---|
protected GeneratorBase(int features, ObjectCodec codec, IOContext ioContext)
| |
| GeneratorBase | back to summary |
|---|---|
| protected GeneratorBase(int features, ObjectCodec codec, JsonWriteContext ctxt)
Deprecated
| |
| GeneratorBase | back to summary |
|---|---|
protected GeneratorBase(int features, ObjectCodec codec, IOContext ioContext, JsonWriteContext jsonWriteContext)
| |
| _asString | back to summary |
|---|---|
| protected String _asString(BigDecimal value) throws IOException Helper method used to serialize a
| |
| _checkRangeBoundsForByteArray | back to summary |
|---|---|
| protected void _checkRangeBoundsForByteArray(byte[] data, int offset, int len) throws IOException | |
| _checkRangeBoundsForCharArray | back to summary |
|---|---|
| protected void _checkRangeBoundsForCharArray(char[] data, int offset, int len) throws IOException | |
| _checkRangeBoundsForString | back to summary |
|---|---|
| protected void _checkRangeBoundsForString(String data, int offset, int len) throws IOException | |
| _checkStdFeatureChanges | back to summary |
|---|---|
| protected void _checkStdFeatureChanges(int newFeatureFlags, int changedFeatures) Helper method called to verify changes to standard features.
| |
| _constructDefaultPrettyPrinter | back to summary |
|---|---|
| protected PrettyPrinter _constructDefaultPrettyPrinter() Overridable factory method called to instantiate an appropriate
| |
| _decodeSurrogate | back to summary |
|---|---|
| protected final int _decodeSurrogate(int surr1, int surr2) throws IOException | |
| _releaseBuffers | back to summary |
|---|---|
| protected abstract void _releaseBuffers() Method called to release any buffers generator may be holding, once generator is being closed. | |
| _verifyValueWrite | back to summary |
|---|---|
| protected abstract void _verifyValueWrite(String typeMsg) throws IOException 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.
| |
| assignCurrentValue | back to summary |
|---|---|
| public void assignCurrentValue(Object v) Overrides com. Doc from com. Helper method, usually equivalent to:
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract com. Implements java. Doc from com. Method called to close this generator, so that no more content can be written.
Whether the underlying target (stream, writer) gets closed depends
on whether this generator either manages the target (i.e. is the
only one with access to the target -- case if caller passes a
reference to the resource such as File, but not stream); or
has feature
| |
| currentValue | back to summary |
|---|---|
| public Object currentValue() Overrides com. Doc from com. Helper method, usually equivalent to:
Note that "current value" is NOT populated (or used) by Streaming parser or generators; it is only used by higher-level data-binding functionality. The reason it is included here is that it can be stored and accessed hierarchically, and gets passed through data-binding. | |
| disable | back to summary |
|---|---|
| public JsonGenerator disable(JsonGenerator. Implements abstract com. Doc from com. Method for disabling specified feature
(check
| |
| enable | back to summary |
|---|---|
| public JsonGenerator enable(JsonGenerator. Implements abstract com. Doc from com. Method for enabling specified generator feature:
check
| |
| flush | back to summary |
|---|---|
| public abstract void flush() throws IOException Redeclares java. Implements abstract com. Doc from com. Method called to flush any buffered content to the underlying target (output stream, writer), and to flush the target itself as well.
| |
| getCodec | back to summary |
|---|---|
| public ObjectCodec getCodec() Implements abstract com. Doc from com. Method for accessing the object used for writing Java
object as JSON content
(using method
| |
| getFeatureMask | back to summary |
|---|---|
| public int getFeatureMask() Implements abstract com. Doc from com. Bulk access method for getting state of all standard (non-dataformat-specific)
| |
| getOutputContext | back to summary |
|---|---|
| public JsonStreamContext getOutputContext() Implements abstract 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.
| |
| ioContext | back to summary |
|---|---|
| public IOContext ioContext() Accessor for use by | |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() Implements abstract com. Doc from com. Method that can be called to determine whether this generator is closed or not. If it is closed, no more output can be done.
| |
| isEnabled | back to summary |
|---|---|
| public final boolean isEnabled(JsonGenerator. Implements abstract com. Doc from com. Method for checking whether given feature is enabled.
Check
| |
| overrideStdFeatures | back to summary |
|---|---|
| public JsonGenerator overrideStdFeatures(int values, int mask) Overrides com. Doc from com. Bulk set method for (re)setting states of features specified by
| |
| setCodec | back to summary |
|---|---|
| public JsonGenerator setCodec(ObjectCodec oc) Implements abstract com. Doc from com. Method that can be called to set or reset the object to
use for writing Java objects as JsonContent
(using method
| |
| setFeatureMask | back to summary |
|---|---|
| public JsonGenerator setFeatureMask(int newMask) Implements abstract com. Doc from com. Deprecated
Bulk set method for (re)setting states of all standard
| |
| useDefaultPrettyPrinter | back to summary |
|---|---|
| public JsonGenerator useDefaultPrettyPrinter() Implements abstract com. Doc from com. Convenience method for enabling pretty-printing using
the default pretty printer
(
| |
| version | back to summary |
|---|---|
| public Version version() Implements abstract 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. | |
| writeBinary | back to summary |
|---|---|
| public int writeBinary(Base64Variant b64variant, InputStream data, int dataLength) throws IOException Implements abstract com. Doc from com. Method similar to
| |
| writeFieldName | back to summary |
|---|---|
| public void writeFieldName(SerializableString name) throws IOException Implements abstract com. Doc from com. Method similar to Default implementation simple uses unprocessed name container in serialized String; implementations are strongly encouraged to make use of more efficient methods argument object has.
| |
| writeObject | back to summary |
|---|---|
| public void writeObject(Object value) throws IOException Implements abstract com. Doc from com. Older alias for
| |
| writeRawValue | back to summary |
|---|---|
| public void writeRawValue(String text) throws IOException Implements abstract com. Doc from 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). Assuming this, proper separators are added if and as needed (comma or colon), and generator state updated to reflect this.
| |
| writeRawValue | back to summary |
|---|---|
| public void writeRawValue(String text, int offset, int len) throws IOException Implements abstract com.
| |
| writeRawValue | back to summary |
|---|---|
| public void writeRawValue(char[] text, int offset, int len) throws IOException Implements abstract com.
| |
| writeRawValue | back to summary |
|---|---|
| public void writeRawValue(SerializableString text) throws IOException Overrides com. Doc from com. Method similar to
| |
| writeStartObject | back to summary |
|---|---|
| public void writeStartObject(Object forValue) throws IOException Overrides com. Doc from com. Method for writing starting marker of an Object value to represent the given Java Object value. Argument is offered as metadata, but more importantly it should be assigned as the "current value" for the Object content that gets constructed and initialized. Object values can be written in any context where values are allowed: meaning everywhere except for when a field name is expected.
| |
| writeString | back to summary |
|---|---|
| public void writeString(SerializableString text) throws IOException Implements abstract com. Doc from com. Method similar to
Default implementation just calls
| |
| writeTree | back to summary |
|---|---|
| public void writeTree(TreeNode rootNode) throws IOException Implements abstract com. Doc from com. Method for writing given JSON tree (expressed as a tree
where given JsonNode is the root) using this generator.
This will generally just call
| |