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. Method that will try to convert value of this node to a Java boolean. |
| public double | asDouble(double defaultValue)
Overrides com. Method that will try to convert value of this node to a Java double. |
| public int | asInt(int defaultValue)
Overrides com. Method that will try to convert value of this node to a Java int. |
| public long | asLong(long defaultValue)
Overrides com. Method that will try to convert value of this node to a Java long. |
| public String | asText()
Implements abstract com. Method that will return a valid String representation of
the container value, if the node is a value node
(method |
| public String | asText(String
The default value to return if this node's text value is absent. defaultValue)Overrides com. Returns the text value of this node or the provided |
| public JsonToken | asToken()
Implements abstract com. Implements com. Method that can be used for efficient type detection when using stream abstraction for traversing nodes. |
| public byte[] | binaryValue()
Overrides com. As it is possible that some implementations embed byte[] as POJONode
(despite optimal being |
| public boolean | equals(Object
the reference object with which to compare. o)Implements abstract com. Equality for node objects is defined as full (deep) value equality. |
| public JsonNodeType | getNodeType()
Implements abstract com. Return the type of this node |
| public Object | |
| public int | hashCode()
Implements abstract com. Returns a hash code value for this object. |
| public final void | serialize(JsonGenerator gen, SerializerProvider ctxt)
Implements abstract com. Implements com. Method called to serialize node instances using given generator. |
| _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. Returns the text value of this node or the provided Note This was deprecated in 2.17.0, but as discussed through [databind#4471], was un-deprecated in 2.17.1. | |
| 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 this 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.
| |