Top Description Inners Fields Constructors Methods
com.fasterxml.jackson.databind.node

pack-priv final Class InternalNodeMapper

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.Arrays, .Iterator, .Map, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.json.JsonMapper, com.fasterxml.jackson.databind.jsontype.TypeSerializer

Helper class used to implement toString() method for BaseJsonNode, by embedding a private instance of JsonMapper, only to be used for node serialization.
Since
2.10 (but not to be included in 3.0)

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
InternalNodeMapper.IteratorStack

Optimized variant similar in functionality to (a subset of) java.util.ArrayDeque; used to hold enclosing Array/Object nodes during recursion-as-iteration.

protected static class
InternalNodeMapper.WrapperForSerializer

Intermediate serializer we need to implement non-recursive serialization of BaseJsonNode.

Field Summary

Modifier and TypeField and Description
private static final JsonMapper
private static final ObjectReader
private static final ObjectWriter
private static final ObjectWriter

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static JsonSerializable
public static JsonNode
bytesToNode(byte[] json)

public static String
public static String
public static byte[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

JSON_MAPPERback to summary
private static final JsonMapper JSON_MAPPER
NODE_READERback to summary
private static final ObjectReader NODE_READER
PRETTY_WRITERback to summary
private static final ObjectWriter PRETTY_WRITER
STD_WRITERback to summary
private static final ObjectWriter STD_WRITER

Constructor Detail

InternalNodeMapperback to summary
pack-priv InternalNodeMapper()

Method Detail

_wrapperback to summary
private static JsonSerializable _wrapper(BaseJsonNode root)
bytesToNodeback to summary
public static JsonNode bytesToNode(byte[] json) throws IOException
nodeToPrettyStringback to summary
public static String nodeToPrettyString(BaseJsonNode n)
nodeToStringback to summary
public static String nodeToString(BaseJsonNode n)
valueToBytesback to summary
public static byte[] valueToBytes(Object value) throws IOException
com.fasterxml.jackson.databind.node back to summary

pack-priv final Class InternalNodeMapper.IteratorStack

extends Object
Class Inheritance
  • java.lang.Object
  • com.fasterxml.jackson.databind.node.InternalNodeMapper.IteratorStack

Optimized variant similar in functionality to (a subset of) java.util.ArrayDeque; used to hold enclosing Array/Object nodes during recursion-as-iteration.

Field Summary

Modifier and TypeField and Description
private int
private Iterator<?>[]
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Iterator<?>
public void
push(Iterator<?> it)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_endback to summary
private int _end
_stackback to summary
private Iterator<?>[] _stack
_topback to summary
private int _top

Constructor Detail

IteratorStackback to summary
public IteratorStack()

Method Detail

popOrNullback to summary
public Iterator<?> popOrNull()
pushback to summary
public void push(Iterator<?> it)
com.fasterxml.jackson.databind.node back to summary

protected Class InternalNodeMapper.WrapperForSerializer

extends Base
Class Inheritance

Intermediate serializer we need to implement non-recursive serialization of BaseJsonNode.

Note

not designed as thread-safe; instances must NOT be shared or reused.

Since
2.14

Field Summary

Modifier and TypeField and Description
protected SerializerProvider
protected final BaseJsonNode

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
protected void
public void
serialize(JsonGenerator g, SerializerProvider ctxt)

Implements com.fasterxml.jackson.databind.JsonSerializable.serialize.

Serialization method called when no additional type information is to be included in serialization.
public void
serializeWithType(JsonGenerator g, SerializerProvider ctxt, TypeSerializer typeSer)

Implements com.fasterxml.jackson.databind.JsonSerializable.serializeWithType.

Serialization method called when additional type information is expected to be included in serialization, for deserialization to use.
Inherited from com.fasterxml.jackson.databind.JsonSerializable.Base:
isEmpty

Field Detail

_contextback to summary
protected SerializerProvider _context
_rootback to summary
protected final BaseJsonNode _root

Constructor Detail

WrapperForSerializerback to summary
public WrapperForSerializer(BaseJsonNode root)

Method Detail

_serializeNonRecursiveback to summary
protected void _serializeNonRecursive(JsonGenerator g, JsonNode node) throws IOException
_serializeNonRecursiveback to summary
protected void _serializeNonRecursive(JsonGenerator g, InternalNodeMapper.IteratorStack stack, final Iterator<?> rootIterator) throws IOException
serializeback to summary
public void serialize(JsonGenerator g, SerializerProvider ctxt) throws IOException

Implements com.fasterxml.jackson.databind.JsonSerializable.serialize.

Doc from com.fasterxml.jackson.databind.JsonSerializable.serialize.

Serialization method called when no additional type information is to be included in serialization.

Annotations
@Override
serializeWithTypeback to summary
public void serializeWithType(JsonGenerator g, SerializerProvider ctxt, TypeSerializer typeSer) throws IOException

Implements com.fasterxml.jackson.databind.JsonSerializable.serializeWithType.

Doc from com.fasterxml.jackson.databind.JsonSerializable.serializeWithType.

Serialization method called when additional type information is expected to be included in serialization, for deserialization to use.

Usually implementation consists of a call to TypeSerializer#writeTypePrefix followed by serialization of contents, followed by a call to TypeSerializer#writeTypeSuffix). Details of the type id argument to pass depend on shape of JSON Object used (Array, Object or scalar like String/Number/Boolean).

Note that some types (most notably, "natural" types: String, Integer, Double and Boolean) never include type information.

Annotations
@Override