Package org.codehaus.jackson.node
Class JsonNodeFactory
java.lang.Object
org.codehaus.jackson.node.JsonNodeFactory
Base class that specifies methods for getting access to
Node instances (newly constructed, or shared, depending
on type), as well as basic implementation of the methods.
Designed to be sub-classed if extended functionality (additions
to behavior of node types, mostly) is needed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonNodeFactory
Default singleton instance that construct "standard" node instances: given that this class is stateless, a globally shared singleton can be used. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFactory method for constructing an empty JSON Array nodebinaryNode
(byte[] data) Factory method for constructing a node that represents given binary data, and will get serialized as equivalent base64-encoded String valuebinaryNode
(byte[] data, int offset, int length) Factory method for constructing a node that represents given binary data, and will get serialized as equivalent base64-encoded String valuebooleanNode
(boolean v) Factory method for getting an instance of JSON boolean value (either literal 'true' or 'false')nullNode()
Factory method for getting an instance of JSON null node (which represents literal null value)numberNode
(byte v) Factory method for getting an instance of JSON numeric value that expresses given 8-bit valuenumberNode
(double v) Factory method for getting an instance of JSON numeric value that expresses given 64-bit floating point valuenumberNode
(float v) Factory method for getting an instance of JSON numeric value that expresses given 32-bit floating point valuenumberNode
(int v) Factory method for getting an instance of JSON numeric value that expresses given 32-bit integer valuenumberNode
(long v) Factory method for getting an instance of JSON numeric value that expresses given 64-bit integer valuenumberNode
(short v) Factory method for getting an instance of JSON numeric value that expresses given 16-bit integer valuenumberNode
(Byte value) Alternate factory method that will handle wrapper value, which may be null.numberNode
(Double value) Alternate factory method that will handle wrapper value, which may be null.numberNode
(Float value) Alternate factory method that will handle wrapper value, which may be null.numberNode
(Integer value) Alternate factory method that will handle wrapper value, which may be null.numberNode
(Long value) Alternate factory method that will handle wrapper value, which may be null.numberNode
(Short value) Alternate factory method that will handle wrapper value, which may be null.Factory method for getting an instance of JSON numeric value that expresses given unlimited precision floating point valueFactory method for getting an instance of JSON numeric value that expresses given unlimited range integer valueFactory method for constructing an empty JSON Object ("struct") nodeFactory method for constructing a wrapper for POJO ("Plain Old Java Object") objects; these will get serialized using data binding, usually as JSON Objects, but in some cases as JSON Strings or other node types.Factory method for constructing a node that represents JSON String value
-
Field Details
-
instance
Default singleton instance that construct "standard" node instances: given that this class is stateless, a globally shared singleton can be used.
-
-
Constructor Details
-
JsonNodeFactory
protected JsonNodeFactory()
-
-
Method Details
-
booleanNode
Factory method for getting an instance of JSON boolean value (either literal 'true' or 'false') -
nullNode
Factory method for getting an instance of JSON null node (which represents literal null value) -
numberNode
Factory method for getting an instance of JSON numeric value that expresses given 8-bit value -
numberNode
Alternate factory method that will handle wrapper value, which may be null. Due to possibility of null, returning type is not guaranteed to beNumericNode
, but justValueNode
.- Since:
- 1.9
-
numberNode
Factory method for getting an instance of JSON numeric value that expresses given 16-bit integer value -
numberNode
Alternate factory method that will handle wrapper value, which may be null. Due to possibility of null, returning type is not guaranteed to beNumericNode
, but justValueNode
.- Since:
- 1.9
-
numberNode
Factory method for getting an instance of JSON numeric value that expresses given 32-bit integer value -
numberNode
Alternate factory method that will handle wrapper value, which may be null. Due to possibility of null, returning type is not guaranteed to beNumericNode
, but justValueNode
.- Since:
- 1.9
-
numberNode
Factory method for getting an instance of JSON numeric value that expresses given 64-bit integer value -
numberNode
Alternate factory method that will handle wrapper value, which may be null. Due to possibility of null, returning type is not guaranteed to beNumericNode
, but justValueNode
.- Since:
- 1.9
-
numberNode
Factory method for getting an instance of JSON numeric value that expresses given unlimited range integer value -
numberNode
Factory method for getting an instance of JSON numeric value that expresses given 32-bit floating point value -
numberNode
Alternate factory method that will handle wrapper value, which may be null. Due to possibility of null, returning type is not guaranteed to beNumericNode
, but justValueNode
.- Since:
- 1.9
-
numberNode
Factory method for getting an instance of JSON numeric value that expresses given 64-bit floating point value -
numberNode
Alternate factory method that will handle wrapper value, which may be null. Due to possibility of null, returning type is not guaranteed to beNumericNode
, but justValueNode
.- Since:
- 1.9
-
numberNode
Factory method for getting an instance of JSON numeric value that expresses given unlimited precision floating point value -
textNode
Factory method for constructing a node that represents JSON String value -
binaryNode
Factory method for constructing a node that represents given binary data, and will get serialized as equivalent base64-encoded String value -
binaryNode
Factory method for constructing a node that represents given binary data, and will get serialized as equivalent base64-encoded String value -
arrayNode
Factory method for constructing an empty JSON Array node -
objectNode
Factory method for constructing an empty JSON Object ("struct") node -
POJONode
Factory method for constructing a wrapper for POJO ("Plain Old Java Object") objects; these will get serialized using data binding, usually as JSON Objects, but in some cases as JSON Strings or other node types.
-