| Modifier and Type | Field and Description |
|---|---|
| protected boolean | _closed
Flag that indicates whether generator is closed or not. |
| protected final IOContext | _ioContext
Low-level I/O context used mostly for buffer recycling. |
| protected final ObjectWriteContext | _objectWriteContext
Context object used both to pass some initial settings and to allow triggering of Object serialization through generator. |
| protected final StreamWriteConstraints | _streamWriteConstraints
Constraints to use for this generator. |
| protected int | _streamWriteFeatures
Bit flag composed of bits that indicate which
|
| protected static final JacksonFeatureSet | DEFAULT_BINARY_WRITE_CAPABILITIES
Default set of |
| protected static final JacksonFeatureSet | DEFAULT_TEXTUAL_WRITE_CAPABILITIES
Default set of |
| protected static final JacksonFeatureSet | DEFAULT_WRITE_CAPABILITIES
Default set of |
| 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 |
| 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 abstract void | |
| 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 void | |
| 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 | close()
Implements abstract tools. Implements java. Method called to close this generator, so that no more content can be written. |
| public final JsonGenerator | configure(StreamWriteFeature f, boolean state)
Implements abstract tools. Method for enabling or disabling specified feature:
check |
| public boolean | has(StreamWriteCapability capability)
Implements abstract tools. Accessor for checking whether this generator has specified capability. |
| public IOContext | |
| public boolean | isClosed()
Implements abstract tools. Method that can be called to determine whether this generator is closed or not. |
| public final boolean | isEnabled(StreamWriteFeature f)
Implements abstract tools. Method for checking whether given feature is enabled. |
| public ObjectWriteContext | objectWriteContext()
Implements abstract tools. Accessor for context object provided by higher-level databinding functionality (or, in some cases, simple placeholder of the same) that allows some level of interaction including ability to trigger serialization of Object values through generator instance. |
| public final StreamWriteConstraints | streamWriteConstraints()
Overrides tools. Get the constraints to apply when performing streaming writes. |
| public final int | streamWriteFeatures()
Implements abstract tools. Bulk access method for getting state of all standard (format-agnostic)
|
| public int | writeBinary(Base64Variant b64variant, InputStream data, int dataLength)
Implements abstract tools. Method similar to |
| public JsonGenerator | writeName(SerializableString name)
Implements abstract tools. Method similar to |
| public JsonGenerator | writePOJO(Object value)
Implements abstract tools. Method for writing given Java object (POJO) as tokens into stream this generator manages; serialization must be a valid JSON Value (Object, Array, null, Number, String or Boolean). |
| public JsonGenerator | writeRawValue(String text)
Implements abstract tools. 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 JsonGenerator | writeRawValue(String text, int offset, int len)
Implements abstract tools.
|
| public JsonGenerator | writeRawValue(char[] text, int offset, int len)
Implements abstract tools.
|
| public JsonGenerator | writeRawValue(SerializableString text)
Overrides tools. Method similar to |
| public JsonGenerator | writeStartArray(Object forValue, int size)
Implements abstract tools. Method for writing start marker of an Array value, similar
to |
| public JsonGenerator | writeStartObject(Object forValue, int size)
Implements abstract tools. Method for writing starting marker of an Object value to represent the given Java Object value. |
| public JsonGenerator | writeString(Reader reader, int len)
Implements abstract tools. Method for outputting a String value. |
| public JsonGenerator | writeString(SerializableString text)
Implements abstract tools. Method similar to |
| public JsonGenerator | writeTree(TreeNode rootNode)
Implements abstract tools. Method for writing given JSON tree (expressed as a tree
where given |
| _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
( | |
| _ioContext | back to summary |
|---|---|
| protected final IOContext _ioContext Low-level I/O context used mostly for buffer recycling. | |
| _objectWriteContext | back to summary |
|---|---|
| protected final ObjectWriteContext _objectWriteContext Context object used both to pass some initial settings and to allow triggering of Object serialization through generator.
| |
| _streamWriteConstraints | back to summary |
|---|---|
| protected final StreamWriteConstraints _streamWriteConstraints Constraints to use for this generator. | |
| _streamWriteFeatures | back to summary |
|---|---|
| protected int _streamWriteFeatures Bit flag composed of bits that indicate which
| |
| DEFAULT_BINARY_WRITE_CAPABILITIES | back to summary |
|---|---|
| protected static final JacksonFeatureSet<StreamWriteCapability> DEFAULT_BINARY_WRITE_CAPABILITIES Default set of | |
| DEFAULT_TEXTUAL_WRITE_CAPABILITIES | back to summary |
|---|---|
| protected static final JacksonFeatureSet<StreamWriteCapability> DEFAULT_TEXTUAL_WRITE_CAPABILITIES Default set of | |
| DEFAULT_WRITE_CAPABILITIES | back to summary |
|---|---|
| protected static final JacksonFeatureSet<StreamWriteCapability> DEFAULT_WRITE_CAPABILITIES Default set of | |
| 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(ObjectWriteContext writeCtxt, IOContext ioCtxt, int streamWriteFeatures) | |
| _asString | back to summary |
|---|---|
| protected String _asString(BigDecimal value) throws JacksonException Helper method used to serialize a
| |
| _checkRangeBoundsForByteArray | back to summary |
|---|---|
| protected void _checkRangeBoundsForByteArray(byte[] data, int offset, int len) throws JacksonException | |
| _checkRangeBoundsForCharArray | back to summary |
|---|---|
| protected void _checkRangeBoundsForCharArray(char[] data, int offset, int len) throws JacksonException | |
| _checkRangeBoundsForString | back to summary |
|---|---|
| protected void _checkRangeBoundsForString(String data, int offset, int len) throws JacksonException | |
| _closeInput | back to summary |
|---|---|
| protected abstract void _closeInput() throws IOException | |
| _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 JacksonException | |
| _releaseBuffers | back to summary |
|---|---|
| protected abstract void _releaseBuffers() Method called to release any buffers generator may be holding, once generator is being closed. | |
| _throwInternal | back to summary |
|---|---|
| protected void _throwInternal() | |
| _verifyValueWrite | back to summary |
|---|---|
| protected abstract void _verifyValueWrite(String typeMsg) throws JacksonException 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.
| |
| close | back to summary |
|---|---|
| public void close() Implements abstract tools. Implements java. Doc from tools. 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
| |
| configure | back to summary |
|---|---|
| public final JsonGenerator configure(StreamWriteFeature f, boolean state) Implements abstract tools. Doc from tools. Method for enabling or disabling specified feature:
check Note mostly left in 3.0 just to support disabling of
| |
| has | back to summary |
|---|---|
| public boolean has(StreamWriteCapability capability) Implements abstract tools. Doc from tools. Accessor for checking whether this generator has specified capability.
Short-hand for:
| |
| ioContext | back to summary |
|---|---|
| public IOContext ioContext() Accessor for use by | |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() Implements abstract tools. Doc from tools. 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(StreamWriteFeature f) Implements abstract tools. Doc from tools. Method for checking whether given feature is enabled.
Check
| |
| objectWriteContext | back to summary |
|---|---|
| public ObjectWriteContext objectWriteContext() Implements abstract tools. Doc from tools. Accessor for context object provided by higher-level databinding functionality (or, in some cases, simple placeholder of the same) that allows some level of interaction including ability to trigger serialization of Object values through generator instance.
| |
| streamWriteConstraints | back to summary |
|---|---|
| public final StreamWriteConstraints streamWriteConstraints() Overrides tools. Doc from tools. Get the constraints to apply when performing streaming writes.
| |
| streamWriteFeatures | back to summary |
|---|---|
| public final int streamWriteFeatures() Implements abstract tools. Doc from tools. Bulk access method for getting state of all standard (format-agnostic)
| |
| writeBinary | back to summary |
|---|---|
| public int writeBinary(Base64Variant b64variant, InputStream data, int dataLength) throws JacksonException Implements abstract tools. Doc from tools. Method similar to
| |
| writeName | back to summary |
|---|---|
| public JsonGenerator writeName(SerializableString name) throws JacksonException Implements abstract tools. Doc from tools. 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.
| |
| writePOJO | back to summary |
|---|---|
| public JsonGenerator writePOJO(Object value) throws JacksonException Implements abstract tools. Doc from tools. Method for writing given Java object (POJO) as tokens into
stream this generator manages; serialization must be a valid JSON Value
(Object, Array, null, Number, String or Boolean).
This is done by delegating call to
| |
| writeRawValue | back to summary |
|---|---|
| public JsonGenerator writeRawValue(String text) throws JacksonException Implements abstract tools. Doc from tools. 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 JsonGenerator writeRawValue(String text, int offset, int len) throws JacksonException Implements abstract tools.
| |
| writeRawValue | back to summary |
|---|---|
| public JsonGenerator writeRawValue(char[] text, int offset, int len) throws JacksonException Implements abstract tools.
| |
| writeRawValue | back to summary |
|---|---|
| public JsonGenerator writeRawValue(SerializableString text) throws JacksonException Overrides tools. Doc from tools. Method similar to
| |
| writeStartArray | back to summary |
|---|---|
| public JsonGenerator writeStartArray(Object forValue, int size) throws JacksonException Implements abstract tools. Doc from tools. Method for writing start marker of an Array value, similar
to
| |
| writeStartObject | back to summary |
|---|---|
| public JsonGenerator writeStartObject(Object forValue, int size) throws JacksonException Implements abstract tools. Doc from tools. 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. In addition, caller knows number of key/value pairs ("properties") that will get written for the Object value: this is relevant for some format backends (but not, as an example, for JSON). Object values can be written in any context where values are allowed: meaning everywhere except for when a property name is expected.
| |
| writeString | back to summary |
|---|---|
| public JsonGenerator writeString(Reader reader, int len) throws JacksonException Implements abstract tools. Doc from tools. Method for outputting a String value. Depending on context
this means either array element, (object) property value or
a stand alone String; but in all cases, String will be
surrounded in double quotes, and contents will be properly
escaped as required by JSON specification.
If Note actual length of content available may exceed
| |
| writeString | back to summary |
|---|---|
| public JsonGenerator writeString(SerializableString text) throws JacksonException Implements abstract tools. Doc from tools. Method similar to
Default implementation just calls
| |
| writeTree | back to summary |
|---|---|
| public JsonGenerator writeTree(TreeNode rootNode) throws JacksonException Implements abstract tools. Doc from tools. Method for writing given JSON tree (expressed as a tree
where given
| |