Top Description Inners Fields Constructors Methods
com.fasterxml.jackson.dataformat.ion

public Class IonGenerator

extends GeneratorBase
Class Inheritance
Imports
java.io.Closeable, .Flushable, .IOException, java.math.BigDecimal, .BigInteger, java.nio.charset.StandardCharsets, java.util.Calendar, com.fasterxml.jackson.core.Base64Variant, .FormatFeature, .JsonGenerator, .ObjectCodec, .StreamWriteCapability, .StreamWriteConstraints, .Version, com.fasterxml.jackson.core.base.GeneratorBase, com.fasterxml.jackson.core.io.IOContext, com.fasterxml.jackson.core.json.JsonWriteContext, com.fasterxml.jackson.core.util.JacksonFeatureSet, com.fasterxml.jackson.dataformat.ion.polymorphism.IonAnnotationTypeSerializer, com.amazon.ion.IonType, .IonValue, .IonWriter, .Timestamp

Implementation of JsonGenerator that will use an underlying IonWriter for actual writing of content.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
IonGenerator.Feature

Enumeration that defines all toggleable features for Ion generators

Field Summary

Modifier and TypeField and Description
protected final Closeable
_destination

Highest-level output abstraction we can use; either OutputStream or Writer.

protected int
_formatFeatures

Bit flag composed of bits that indicate which IonGenerator.Features are enabled.

protected final boolean
protected final StreamWriteConstraints
protected final IonWriter
Inherited from com.fasterxml.jackson.core.base.GeneratorBase:
_cfgNumbersAsStrings_closed_features_ioContext_objectCodec_writeContextDERIVED_FEATURES_MASKMAX_BIG_DECIMAL_SCALESURR1_FIRSTSURR1_LASTSURR2_FIRSTSURR2_LASTWRITE_BINARYWRITE_BOOLEANWRITE_NULLWRITE_NUMBERWRITE_RAWWRITE_STRING

Constructor Summary

AccessConstructor and Description
public
IonGenerator(int jsonFeatures, final int ionFeatures, ObjectCodec codec, IonWriter ion, boolean ionWriterIsManaged, IOContext ctxt, Closeable dst)

Method Summary

Modifier and TypeMethod and Description
protected void
_releaseBuffers()

Implements abstract com.fasterxml.jackson.core.base.GeneratorBase._releaseBuffers.

Method called to release any buffers generator may be holding, once generator is being closed.

protected void
protected void
_verifyValueWrite(String
Additional message used for generating exception message if value output is NOT legal in current generator output state.
msg
)

Implements abstract com.fasterxml.jackson.core.base.GeneratorBase._verifyValueWrite.

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.

protected void
public void
annotateNextValue(String
a type annotation
annotation
)

Annotates the next structure or value written -- stepIn() or one of the IonWriters write*() methods.

public boolean
canWriteBinaryNatively()

Overrides com.fasterxml.jackson.core.JsonGenerator.canWriteBinaryNatively.

Introspection method that may be called to see if the underlying data format supports "native" binary data; that is, an efficient output of binary content without encoding.

public boolean
canWriteTypeId()

Overrides com.fasterxml.jackson.core.JsonGenerator.canWriteTypeId.

Introspection method that may be called to see if the underlying data format supports some kind of Type Ids natively (many do not; for example, JSON doesn't).

public void
close()

Overrides com.fasterxml.jackson.core.base.GeneratorBase.close.

Implements java.io.Closeable.close.

Method called to close this generator, so that no more content can be written.

public void
flush()

Implements abstract com.fasterxml.jackson.core.base.GeneratorBase.flush.

Implements java.io.Flushable.flush.

Method called to flush any buffered content to the underlying target (output stream, writer), and to flush the target itself as well.

public JacksonFeatureSet<StreamWriteCapability>
getWriteCapabilities()

Overrides com.fasterxml.jackson.core.JsonGenerator.getWriteCapabilities.

Accessor for getting metadata on capabilities of this generator, based on underlying data format being read (directly or indirectly).

public boolean
isClosed()

Overrides com.fasterxml.jackson.core.base.GeneratorBase.isClosed.

Method that can be called to determine whether this generator is closed or not.

public StreamWriteConstraints
streamWriteConstraints()

Overrides com.fasterxml.jackson.core.JsonGenerator.streamWriteConstraints.

Get the constraints to apply when performing streaming writes.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public Version
version()

Overrides com.fasterxml.jackson.core.base.GeneratorBase.version.

Implements com.fasterxml.jackson.core.Versioned.version.

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.
b64v
,
byte[]
Buffer that contains binary data to write
data
,
int
Offset in data of the first byte of data to write
offset
,
int
Length of data to write
length
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeBinary.

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
value
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeBoolean.

Method for outputting literal JSON boolean value (one of Strings 'true' and 'false').

public void
public void
writeEndArray()

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeEndArray.

Method for writing closing marker of a JSON Array value (character ']'; plus possible white space decoration if pretty-printing is enabled).

public void
writeEndObject()

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeEndObject.

Method for writing closing marker of an Object value (character '}'; plus possible white space decoration if pretty-printing is enabled).

public void
public void
writeFieldName(String
Field name to write
value
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeFieldName.

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 void
writeNull()

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeNull.

Method for outputting literal JSON null value.

public void
writeNull(IonType ionType)

public void
writeNumber(int
Number value to write
value
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeNumber.

Method for outputting given value as JSON number.

public void
writeNumber(long
Number value to write
value
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeNumber.

Method for outputting given value as JSON number.

public void
writeNumber(BigInteger
Number value to write
value
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeNumber.

Method for outputting given value as JSON number.

public void
writeNumber(double
Number value to write
value
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeNumber.

Method for outputting indicate JSON numeric value.

public void
writeNumber(float
Number value to write
value
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeNumber.

Method for outputting indicate JSON numeric value.

public void
writeNumber(BigDecimal
Number value to write
value
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeNumber.

Method for outputting indicate JSON numeric value.

public void
writeNumber(String
Textual (possibly formatted) number representation to write
value
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeNumber.

Write method that can be used for custom numeric types that can not be (easily?) converted to "standard" Java number types.

public void
writeObject(Object
Java value (usually POJO) to write
pojo
)

Overrides com.fasterxml.jackson.core.base.GeneratorBase.writeObject.

Older alias for writePOJO(Object)

public void
writeRaw(String
Textual contents to include as-is in output.
value
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeRaw.

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
value
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeRaw.

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
value
,
int
Offset within text of the first character to output
arg1
,
int
Length of content (from text, starting at offset offset) to output
arg2
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeRaw.

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
value
,
int
Offset within text of the first character to output
arg1
,
int
Length of content (from text, starting at offset offset) to output
arg2
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeRaw.

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 buffer of the first byte of String value to write
offset
,
int
Length of the String value (in characters) to write
length
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeRawUTF8String.

Method similar to writeString(String) but that takes as its input a UTF-8 encoded String that is to be output as-is, without additional escaping (type of which depends on data format; backslashes for JSON).

public void
writeRawValue(String
Textual contents to included in output
value
)

Overrides com.fasterxml.jackson.core.base.GeneratorBase.writeRawValue.

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
public void
public void
writeStartArray()

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeStartArray.

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 void
writeStartObject()

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeStartObject.

Method for writing starting marker of an Object value (character '{'; plus possible white space decoration if pretty-printing is enabled).

public void
public void
writeString(String
Text value to write
value
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeString.

Method for outputting a String value.

public void
writeString(char[]
Buffer that contains String value to write
buffer
,
int
Offset in buffer of the first character of String value to write
offset
,
int
Length of the String value (in characters) to write
length
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeString.

Method for outputting a String value.

public void
public void
writeTypeId(Object
Native Type Id to write
rawId
)

Overrides com.fasterxml.jackson.core.JsonGenerator.writeTypeId.

Method that can be called to output so-called native Type Id. Note that it may only be called after ensuring this is legal (with canWriteTypeId()), as not all data formats have native type id support; and some may only allow them in certain positions or locations.

public void
writeUTF8String(byte[]
Buffer that contains String value to write
buffer
,
int
Offset in buffer of the first byte of String value to write
offset
,
int
Length of the String value (in characters) to write
length
)

Implements abstract com.fasterxml.jackson.core.JsonGenerator.writeUTF8String.

Method similar to writeString(String) but that takes as its input a UTF-8 encoded String which has not been escaped using whatever escaping scheme data format requires (for JSON that is backslash-escaping for control characters and double-quotes; for other formats something else).

public void
public void
Inherited from com.fasterxml.jackson.core.base.GeneratorBase:
_asString_checkRangeBoundsForByteArray_checkRangeBoundsForCharArray_checkRangeBoundsForString_checkStdFeatureChanges_constructDefaultPrettyPrinter_decodeSurrogatedisableenablegetCodecgetCurrentValuegetFeatureMaskgetOutputContextisEnabledoverrideStdFeaturessetCodecsetCurrentValuesetFeatureMaskuseDefaultPrettyPrinterwriteBinarywriteFieldNamewriteRawValuewriteStartObjectwriteStringwriteTree