Java com.fasterxml.jackson.core JsonGenerator fields, constructors, methods, implement or subclass

Example usage for Java com.fasterxml.jackson.core JsonGenerator fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.fasterxml.jackson.core JsonGenerator.

The text is from its open source code.

Subclass

com.fasterxml.jackson.core.JsonGenerator has subclasses.
Click this link to see all its subclasses.

Method

voidclose()
Method called to close this generator, so that no more content can be written.
JsonGeneratorconfigure(Feature f, boolean state)
Method for enabling or disabling specified feature: check Feature for list of available features.
voidcopyCurrentEvent(JsonParser jp)
Method for copying contents of the current event that the given parser instance points to.
voidcopyCurrentStructure(JsonParser jp)
Method for copying contents of the current event and following events that it encloses the given parser instance points to.
JsonGeneratordisable(Feature f)
Method for disabling specified features (check Feature for list of features)
voidflush()
Method called to flush any buffered content to the underlying target (output stream, writer), and to flush the target itself as well.
ClassgetClass()
Returns the runtime class of this Object .
ObjectCodecgetCodec()
Method for accessing the object used for writing Java object as Json content (using method #writeObject ).
JsonStreamContextgetOutputContext()
ObjectgetOutputTarget()
Method that can be used to get access to object that is used as target for generated output; this is usually either OutputStream or Writer , depending on what generator was constructed with.
PrettyPrintergetPrettyPrinter()
Accessor for checking whether this generator has a configured PrettyPrinter ; returns it if so, null if none configured.
booleanisClosed()
Method that can be called to determine whether this generator is closed or not.
JsonGeneratorsetCharacterEscapes(CharacterEscapes esc)
Method for defining custom escapes factory uses for JsonGenerator s it creates.
JsonGeneratorsetCodec(ObjectCodec oc)
Method that can be called to set or reset the object to use for writing Java objects as JsonContent (using method #writeObject ).
JsonGeneratorsetPrettyPrinter(PrettyPrinter pp)
Method for setting a custom pretty printer, which is usually used to add indentation for improved human readability.
JsonGeneratoruseDefaultPrettyPrinter()
Convenience method for enabling pretty-printing using the default pretty printer ( com.fasterxml.jackson.core.util.DefaultPrettyPrinter ).
voidwriteArrayFieldStart(String fieldName)
Convenience method for outputting a field entry ("member") (that will contain a JSON Array value), and the START_ARRAY marker.
voidwriteBinary(byte[] data, int offset, int len)
Similar to #writeBinary(Base64Variant,byte[],int,int) , but default to using the Jackson default Base64 variant (which is Base64Variants#MIME_NO_LINEFEEDS ).
intwriteBinary(Base64Variant b64variant, InputStream data, int dataLength)
Method similar to #writeBinary(Base64Variant,byte[],int,int) , but where input is provided through a stream, allowing for incremental writes without holding the whole input in memory.
voidwriteBinary(byte[] data)
Similar to #writeBinary(Base64Variant,byte[],int,int) , but assumes default to using the Jackson default Base64 variant (which is Base64Variants#MIME_NO_LINEFEEDS ).
voidwriteBinaryField(String fieldName, byte[] data)
Convenience method for outputting a field entry ("member") that contains specified data in base64-encoded form.
voidwriteBoolean(boolean state)
Method for outputting literal Json boolean value (one of Strings 'true' and 'false').
voidwriteBooleanField(String fieldName, boolean value)
Convenience method for outputting a field entry ("member") that has a boolean value.
voidwriteEndArray()
Method for writing closing marker of a JSON Array value (character ']'; plus possible white space decoration if pretty-printing is enabled).
voidwriteEndObject()
Method for writing closing marker of a JSON Object value (character '}'; plus possible white space decoration if pretty-printing is enabled).
voidwriteFieldName(String name)
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.
voidwriteFieldName(SerializableString name)
Method similar to #writeFieldName(String) , main difference being that it may perform better as some of processing (such as quoting of certain characters, or encoding into external encoding if supported by generator) can be done just once and reused for later calls.
voidwriteNull()
Method for outputting literal Json null value.
voidwriteNullField(String fieldName)
Convenience method for outputting a field entry ("member") that has JSON literal value null.
voidwriteNumber(short v)
Method for outputting given value as Json number.
voidwriteNumber(int v)
Method for outputting given value as Json number.
voidwriteNumber(long v)
Method for outputting given value as Json number.
voidwriteNumber(BigInteger v)
Method for outputting given value as Json number.
voidwriteNumber(double d)
Method for outputting indicate Json numeric value.
voidwriteNumber(float f)
Method for outputting indicate Json numeric value.
voidwriteNumber(BigDecimal dec)
Method for outputting indicate Json numeric value.
voidwriteNumber(String encodedValue)
Write method that can be used for custom numeric types that can not be (easily?) converted to "standard" Java number types.
voidwriteNumberField(String fieldName, int value)
Convenience method for outputting a field entry ("member") that has the specified numeric value.
voidwriteNumberField(String fieldName, long value)
Convenience method for outputting a field entry ("member") that has the specified numeric value.
voidwriteNumberField(String fieldName, double value)
Convenience method for outputting a field entry ("member") that has the specified numeric value.
voidwriteNumberField(String fieldName, float value)
Convenience method for outputting a field entry ("member") that has the specified numeric value.
voidwriteNumberField(String fieldName, BigDecimal value)
Convenience method for outputting a field entry ("member") that has the specified numeric value.
voidwriteObject(Object pojo)
Method for writing given Java object (POJO) as Json.
voidwriteObjectField(String fieldName, Object pojo)
Convenience method for outputting a field entry ("member") that has contents of specific Java object as its value.
voidwriteObjectFieldStart(String fieldName)
Convenience method for outputting a field entry ("member") (that will contain a JSON Object value), and the START_OBJECT marker.
voidwriteRaw(String text)
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).
voidwriteRaw(char c)
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).
voidwriteRaw(SerializableString raw)
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).
voidwriteRawValue(String text)
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).
voidwriteStartArray()
Method for writing starting marker of a JSON Array value (character '['; plus possible white space decoration if pretty-printing is enabled).
voidwriteStartObject()
Method for writing starting marker of a JSON Object value (character '{'; plus possible white space decoration if pretty-printing is enabled).
voidwriteString(String text)
Method for outputting a String value.
voidwriteString(SerializableString text)
Method similar to #writeString(String) , but that takes SerializableString which can make this potentially more efficient to call as generator may be able to reuse quoted and/or encoded representation.
voidwriteStringField(String fieldName, String value)
Convenience method for outputting a field entry ("member") that has a String value.
voidwriteTree(TreeNode rootNode)
Method for writing given JSON tree (expressed as a tree where given JsonNode is the root) using this generator.
voidwriteUTF8String(byte[] text, int offset, int length)
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).