com.fasterxml.jackson.databind.ObjectMapper ).
| Modifier and Type | Field and Description |
|---|---|
| protected final Object | |
| private static final long |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | |
| public boolean | asBoolean(boolean defaultValue)
Overrides com. |
| public double | asDouble(double defaultValue)
Method that will try to convert value of this node to a Java double.
|
| public int | asInt(int defaultValue)
Method that will try to convert value of this node to a Java int.
|
| public long | asLong(long defaultValue)
Method that will try to convert value of this node to a Java long.
|
| public String | asText()
Implements abstract com. isValueNode returns true),
otherwise empty String.
|
| public String | asText(String defaultValue)
Overrides com. asText(), except that it will return
defaultValue in cases where null value would be returned;
either for missing nodes (trying to access missing property, or element
at invalid item for array) or explicit nulls.
|
| public JsonToken | asToken()
Implements abstract com. Implements com. |
| public byte[] | binaryValue()
Overrides com. BinaryNode), let's add support for exposing
binary data here too.
|
| public boolean | equals(Object
the reference object with which to compare. o)Implements abstract com. |
| public JsonNodeType | getNodeType()
Implements abstract com. |
| public Object | |
| public int | hashCode()
Implements abstract com. |
| public final void | serialize(JsonGenerator gen, SerializerProvider ctxt)
Implements abstract com. Implements com. |
| _value | back to summary |
|---|---|
| protected final Object _value | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| POJONode | back to summary |
|---|---|
| public POJONode(Object v) | |
| _pojoEquals | back to summary |
|---|---|
protected boolean _pojoEquals(POJONode other)
| |
| asBoolean | back to summary |
|---|---|
| public boolean asBoolean(boolean defaultValue) Overrides com. Doc from com. Method that will try to convert value of this node to a Java boolean. JSON booleans map naturally; integer numbers other than 0 map to true, and 0 maps to false and Strings 'true' and 'false' map to corresponding values. If representation cannot be converted to a boolean value (including structured types like Objects and Arrays), specified defaultValue will be returned; no exceptions are thrown.
| |
| asDouble | back to summary |
|---|---|
| public double asDouble(double defaultValue) Overrides com. Doc from com. Method that will try to convert value of this node to a Java double. Numbers are coerced using default Java rules; booleans convert to 0.0 (false) and 1.0 (true), and Strings are parsed using default Java language integer parsing rules. If representation cannot be converted to an int (including structured types like Objects and Arrays), specified defaultValue will be returned; no exceptions are thrown.
| |
| asInt | back to summary |
|---|---|
| public int asInt(int defaultValue) Overrides com. Doc from com. Method that will try to convert value of this node to a Java int. Numbers are coerced using default Java rules; booleans convert to 0 (false) and 1 (true), and Strings are parsed using default Java language integer parsing rules. If representation cannot be converted to an int (including structured types like Objects and Arrays), specified defaultValue will be returned; no exceptions are thrown.
| |
| asLong | back to summary |
|---|---|
| public long asLong(long defaultValue) Overrides com. Doc from com. Method that will try to convert value of this node to a Java long. Numbers are coerced using default Java rules; booleans convert to 0 (false) and 1 (true), and Strings are parsed using default Java language integer parsing rules. If representation cannot be converted to a long (including structured types like Objects and Arrays), specified defaultValue will be returned; no exceptions are thrown.
| |
| asText | back to summary |
|---|---|
| public String asText() Implements abstract com. Doc from com. Method that will return a valid String representation of
the container value, if the node is a value node
(method
| |
| asText | back to summary |
|---|---|
| public String asText(String defaultValue) Overrides com. Doc from com. Method similar to
| |
| asToken | back to summary |
|---|---|
| public JsonToken asToken() Implements abstract com. Implements com. Doc from com. Method that can be used for efficient type detection
when using stream abstraction for traversing nodes.
Will return the first
| |
| binaryValue | back to summary |
|---|---|
| public byte[] binaryValue() throws IOException Overrides com. As it is possible that some implementations embed byte[] as POJONode
(despite optimal being
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Implements abstract com. Doc from com. Equality for node objects is defined as full (deep) value equality. This means that it is possible to compare complete JSON trees for equality by comparing equality of root nodes. Note marked as abstract to ensure all implementation
classes define it properly and not rely on definition
from
| |
| getNodeType | back to summary |
|---|---|
| public JsonNodeType getNodeType() Implements abstract com. Doc from com. Return the type of this node
| |
| getPojo | back to summary |
|---|---|
| public Object getPojo() Method that can be used to access the POJO this node wraps. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract com. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| serialize | back to summary |
|---|---|
| public final void serialize(JsonGenerator gen, SerializerProvider ctxt) throws IOException Implements abstract com. Implements com. Doc from com. Method called to serialize node instances using given generator.
| |