|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.jackson.JsonNode
org.codehaus.jackson.node.BaseJsonNode
public abstract class BaseJsonNode
Abstract base class common to all standard JsonNode
implementations.
The main addition here is that we declare that sub-classes must
implement JsonSerializableWithType
.
This simplifies object mapping
aspects a bit, as no external serializers are needed.
Constructor Summary | |
---|---|
protected |
BaseJsonNode()
|
Method Summary | |
---|---|
abstract JsonToken |
asToken()
Method that can be used for efficient type detection when using stream abstraction for traversing nodes. |
JsonParser.NumberType |
getNumberType()
If this node is a numeric type (as per JsonNode.isNumber() ),
returns native type that node uses to store the numeric
value. |
abstract void |
serialize(JsonGenerator jgen,
SerializerProvider provider)
Method called to serialize node instances using given generator. |
void |
serializeWithType(JsonGenerator jgen,
SerializerProvider provider,
TypeSerializer typeSer)
Since JSON node typing is only based on JSON values, there is no need to include type information. |
JsonParser |
traverse()
Method for constructing a JsonParser instance for
iterating over contents of the tree that this
node is root of. |
void |
writeTo(JsonGenerator jgen)
Note: this method is deprecated, given that we want to use the standard serialization interface. |
Methods inherited from class org.codehaus.jackson.JsonNode |
---|
equals, get, get, getBigIntegerValue, getBinaryValue, getBooleanValue, getDecimalValue, getDoubleValue, getElements, getElementValue, getFieldNames, getFieldValue, getIntValue, getLongValue, getNumberValue, getPath, getPath, getTextValue, getValueAsText, isArray, isBigDecimal, isBigInteger, isBinary, isBoolean, isContainerNode, isDouble, isFloatingPointNumber, isInt, isIntegralNumber, isLong, isMissingNode, isNull, isNumber, isObject, isPojo, isTextual, isValueNode, iterator, path, path, size, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected BaseJsonNode()
Method Detail |
---|
public JsonParser traverse()
JsonNode
JsonParser
instance for
iterating over contents of the tree that this
node is root of.
Functionally equivalent to first serializing tree
using JsonNode.writeTo(org.codehaus.jackson.JsonGenerator)
and then re-parsing but much
more efficient.
traverse
in class JsonNode
public abstract JsonToken asToken()
JsonToken
that equivalent
stream event would produce (for most nodes there is just
one token but for structured/container types multiple)
asToken
in class JsonNode
public JsonParser.NumberType getNumberType()
JsonNode
JsonNode.isNumber()
),
returns native type that node uses to store the numeric
value.
getNumberType
in class JsonNode
public abstract void serialize(JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException
serialize
in interface JsonSerializable
IOException
JsonProcessingException
public void serializeWithType(JsonGenerator jgen, SerializerProvider provider, TypeSerializer typeSer) throws IOException, JsonProcessingException
serializeWithType
in interface JsonSerializableWithType
IOException
JsonProcessingException
public final void writeTo(JsonGenerator jgen) throws IOException, JsonGenerationException
Note: this method is deprecated, given that we want to use the standard serialization interface.
writeTo
in class JsonNode
IOException
JsonGenerationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |