| Modifier and Type | Field and Description |
|---|---|
| protected final String | |
| pack-priv static final TextNode | |
| private static final long |
| Modifier and Type | Method and Description |
|---|---|
| protected static void | |
| 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. isBinary returns true); or for Text Nodes
(ones for which textValue returns non-null value),
to read decoded base64 data.
|
| public boolean | equals(Object
the reference object with which to compare. o)Implements abstract com. |
| public byte[] | getBinaryValue(Base64Variant b64variant)
Method for accessing textual contents assuming they were base64 encoded; if so, they are decoded and resulting binary data is returned. |
| public JsonNodeType | getNodeType()
Implements abstract com. |
| public int | hashCode()
Implements abstract com. |
| public final void | serialize(JsonGenerator g, SerializerProvider provider)
Implements abstract com. Implements com. |
| public String | textValue()
Overrides com. |
| public static TextNode |
| _value | back to summary |
|---|---|
| protected final String _value | |
| EMPTY_STRING_NODE | back to summary |
|---|---|
| pack-priv static final TextNode EMPTY_STRING_NODE | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| TextNode | back to summary |
|---|---|
| public TextNode(String v) | |
| appendQuoted | back to summary |
|---|---|
| protected static void appendQuoted(StringBuilder sb, String content)
Deprecated
| |
| 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. Doc from com. Method to use for accessing binary content of binary nodes (nodes
for which
| |
| 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
| |
| getBinaryValue | back to summary |
|---|---|
| public byte[] getBinaryValue(Base64Variant b64variant) throws IOException Method for accessing textual contents assuming they were base64 encoded; if so, they are decoded and resulting binary data is returned.
| |
| getNodeType | back to summary |
|---|---|
| public JsonNodeType getNodeType() Implements abstract com. Doc from com. Return the type of this node
| |
| 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 g, SerializerProvider provider) throws IOException Implements abstract com. Implements com. Doc from com. Method called to serialize node instances using given generator.
| |
| textValue | back to summary |
|---|---|
| public String textValue() Overrides com. Doc from com. Method to use for accessing String values.
Does NOT do any conversions for non-String value nodes;
for non-String values (ones for which | |
| valueOf | back to summary |
|---|---|
| public static TextNode valueOf(String v) Factory method that should be used to construct instances. For some common cases, can reuse canonical instances: currently this is the case for empty Strings, in future possible for others as well. If null is passed, will return null. | |