public abstract class JsonGeneratorImpl extends GeneratorBase
UTF8JsonGenerator
and WriterBasedJsonGenerator
.JsonGenerator.Feature
SURR1_FIRST, SURR1_LAST, SURR2_FIRST, SURR2_LAST
Constructor and Description |
---|
JsonGeneratorImpl(IOContext ctxt,
int features,
ObjectCodec codec) |
Modifier and Type | Method and Description |
---|---|
JsonGenerator |
disable(JsonGenerator.Feature f)
Method for disabling specified features
(check
JsonGenerator.Feature for list of features) |
JsonGenerator |
enable(JsonGenerator.Feature f)
Method for enabling specified parser features:
check
JsonGenerator.Feature for list of available features. |
CharacterEscapes |
getCharacterEscapes()
Method for accessing custom escapes factory uses for
JsonGenerator s
it creates. |
int |
getHighestEscapedChar()
Accessor method for testing what is the highest unescaped character
configured for this generator.
|
JsonGenerator |
setCharacterEscapes(CharacterEscapes esc)
Method for defining custom escapes factory uses for
JsonGenerator s
it creates. |
JsonGenerator |
setHighestNonEscapedChar(int charCode)
Method that can be called to request that generator escapes
all character codes above specified code point (if positive value);
or, to not escape any characters except for ones that must be
escaped for the data format (if -1).
|
JsonGenerator |
setRootValueSeparator(SerializableString sep)
Method that allows overriding String used for separating root-level
JSON values (default is single space character)
|
Version |
version()
Implemented with standard version number detection algorithm, typically using
a simple generated class, with information extracted from Maven project file
during build.
|
void |
writeStringField(java.lang.String fieldName,
java.lang.String value)
Convenience method for outputting a field entry ("member")
that has a String value.
|
close, flush, getCodec, getCurrentValue, getFeatureMask, getOutputContext, isClosed, isEnabled, overrideStdFeatures, setCodec, setCurrentValue, setFeatureMask, useDefaultPrettyPrinter, writeBinary, writeFieldName, writeObject, writeRawValue, writeRawValue, writeRawValue, writeRawValue, writeStartObject, writeString, writeTree
canOmitFields, canUseSchema, canWriteBinaryNatively, canWriteFormattedNumbers, canWriteObjectId, canWriteTypeId, configure, copyCurrentEvent, copyCurrentStructure, getFormatFeatures, getOutputBuffered, getOutputTarget, getPrettyPrinter, getSchema, isEnabled, overrideFormatFeatures, setPrettyPrinter, setSchema, writeArray, writeArray, writeArray, writeArrayFieldStart, writeBinary, writeBinary, writeBinary, writeBinary, writeBinaryField, writeBoolean, writeBooleanField, writeEmbeddedObject, writeEndArray, writeEndObject, writeFieldId, writeFieldName, writeNull, writeNullField, writeNumber, writeNumber, writeNumber, writeNumber, writeNumber, writeNumber, writeNumber, writeNumber, writeNumberField, writeNumberField, writeNumberField, writeNumberField, writeNumberField, writeObjectField, writeObjectFieldStart, writeObjectId, writeObjectRef, writeOmittedField, writeRaw, writeRaw, writeRaw, writeRaw, writeRaw, writeRawUTF8String, writeStartArray, writeStartArray, writeStartArray, writeStartArray, writeStartObject, writeStartObject, writeString, writeString, writeString, writeTypeId, writeTypePrefix, writeTypeSuffix, writeUTF8String
public JsonGeneratorImpl(IOContext ctxt, int features, ObjectCodec codec)
public Version version()
GeneratorBase
version
in interface Versioned
version
in class GeneratorBase
public JsonGenerator enable(JsonGenerator.Feature f)
JsonGenerator
JsonGenerator.Feature
for list of available features.enable
in class GeneratorBase
public JsonGenerator disable(JsonGenerator.Feature f)
JsonGenerator
JsonGenerator.Feature
for list of features)disable
in class GeneratorBase
public JsonGenerator setHighestNonEscapedChar(int charCode)
JsonGenerator
Note that generators are NOT required to support setting of value higher than 127, because there are other ways to affect quoting (or lack thereof) of character codes between 0 and 127. Not all generators support concept of escaping, either; if so, calling this method will have no effect.
Default implementation does nothing; sub-classes need to redefine it according to rules of supported data format.
setHighestNonEscapedChar
in class JsonGenerator
charCode
- Either -1 to indicate that no additional escaping
is to be done; or highest code point not to escape (meaning higher
ones will be), if positive value.public int getHighestEscapedChar()
JsonGenerator
getHighestEscapedChar
in class JsonGenerator
public JsonGenerator setCharacterEscapes(CharacterEscapes esc)
JsonGenerator
JsonGenerator
s
it creates.
Default implementation does nothing and simply returns this instance.
setCharacterEscapes
in class JsonGenerator
public CharacterEscapes getCharacterEscapes()
JsonGenerator
s
it creates.getCharacterEscapes
in class JsonGenerator
public JsonGenerator setRootValueSeparator(SerializableString sep)
JsonGenerator
Default implementation throws UnsupportedOperationException
.
setRootValueSeparator
in class JsonGenerator
sep
- Separator to use, if any; null means that no separator is
automatically addedpublic final void writeStringField(java.lang.String fieldName, java.lang.String value) throws java.io.IOException
JsonGenerator
writeFieldName(fieldName); writeString(value);
Note: many performance-sensitive implementations override this method
writeStringField
in class JsonGenerator
java.io.IOException
Copyright © 2010 - 2020 Adobe. All Rights Reserved