Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.node

public Class BinaryNode

extends ValueNode
Class Inheritance
Imports
java.io.IOException, java.util.Arrays, com.fasterxml.jackson.core.*, com.fasterxml.jackson.databind.SerializerProvider

Value node that contains Base64 encoded binary value, which will be output and stored as Json String value.

Field Summary

Modifier and TypeField and Description
protected final byte[]
pack-priv static final BinaryNode
private static final long

Constructor Summary

AccessConstructor and Description
public
BinaryNode(byte[] data)

public
BinaryNode(byte[] data, int offset, int length)

Method Summary

Modifier and TypeMethod and Description
public String
public JsonToken
asToken()

Implements abstract com.fasterxml.jackson.databind.node.ValueNode.asToken.

Implements com.fasterxml.jackson.core.TreeNode.asToken.

Method that can be used for efficient type detection when using stream abstraction for traversing nodes.

public byte[]
binaryValue()

Overrides com.fasterxml.jackson.databind.JsonNode.binaryValue.

Note

caller is not to modify returned array in any way, since it is not a copy but reference to the underlying byte array.

public boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract com.fasterxml.jackson.databind.JsonNode.equals.

Equality for node objects is defined as full (deep) value equality.

public JsonNodeType
getNodeType()

Implements abstract com.fasterxml.jackson.databind.JsonNode.getNodeType.

Return the type of this node

public int
hashCode()

Implements abstract com.fasterxml.jackson.databind.node.BaseJsonNode.hashCode.

Returns a hash code value for this object.

public final void
serialize(JsonGenerator g, SerializerProvider provider)

Implements abstract com.fasterxml.jackson.databind.node.BaseJsonNode.serialize.

Implements com.fasterxml.jackson.databind.JsonSerializable.serialize.

Method called to serialize node instances using given generator.

public static BinaryNode
valueOf(byte[] data)

public static BinaryNode
valueOf(byte[] data, int offset, int length)

Inherited from com.fasterxml.jackson.databind.node.ValueNode:
_atdeepCopyfindParentfindParentsfindValuefindValuesfindValuesAsTextgetgethashashasNonNullhasNonNullisEmptypathpathserializeWithType

Field Detail

_databack to summary
protected final byte[] _data
EMPTY_BINARY_NODEback to summary
pack-priv static final BinaryNode EMPTY_BINARY_NODE
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.node.ValueNode.serialVersionUID.

Constructor Detail

BinaryNodeback to summary
public BinaryNode(byte[] data)
BinaryNodeback to summary
public BinaryNode(byte[] data, int offset, int length)

Method Detail

asTextback to summary
public String asText()

Implements abstract com.fasterxml.jackson.databind.JsonNode.asText.

Hmmh. This is not quite as efficient as using serialize, but will work correctly.

Annotations
@Override
asTokenback to summary
public JsonToken asToken()

Implements abstract com.fasterxml.jackson.databind.node.ValueNode.asToken.

Implements com.fasterxml.jackson.core.TreeNode.asToken.

Doc from com.fasterxml.jackson.databind.node.BaseJsonNode.asToken.

Method that can be used for efficient type detection when using stream abstraction for traversing nodes. Will return the first JsonToken that equivalent stream event would produce (for most nodes there is just one token but for structured/container types multiple)

Returns:JsonToken

Doc from com.fasterxml.jackson.core.TreeNode.asToken.

JsonToken that is most closely associated with the node type

Annotations
@Override
binaryValueback to summary
public byte[] binaryValue()

Overrides com.fasterxml.jackson.databind.JsonNode.binaryValue.

Note

caller is not to modify returned array in any way, since it is not a copy but reference to the underlying byte array.

Returns:byte[]

Doc from com.fasterxml.jackson.databind.JsonNode.binaryValue.

Binary data this node contains, iff it is a binary node; null otherwise

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Implements abstract com.fasterxml.jackson.databind.JsonNode.equals.

Doc from com.fasterxml.jackson.databind.JsonNode.equals.

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 java.lang.Object.

Parameters
o:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getNodeTypeback to summary
public JsonNodeType getNodeType()

Implements abstract com.fasterxml.jackson.databind.JsonNode.getNodeType.

Doc from com.fasterxml.jackson.databind.JsonNode.getNodeType.

Return the type of this node

Returns:JsonNodeType

the node type as a JsonNodeType enum value

Annotations
@Override
hashCodeback to summary
public int hashCode()

Implements abstract com.fasterxml.jackson.databind.node.BaseJsonNode.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
serializeback to summary
public final void serialize(JsonGenerator g, SerializerProvider provider) throws IOException

Implements abstract com.fasterxml.jackson.databind.node.BaseJsonNode.serialize.

Implements com.fasterxml.jackson.databind.JsonSerializable.serialize.

Doc from com.fasterxml.jackson.databind.node.BaseJsonNode.serialize.

Method called to serialize node instances using given generator.

Annotations
@Override
valueOfback to summary
public static BinaryNode valueOf(byte[] data)
valueOfback to summary
public static BinaryNode valueOf(byte[] data, int offset, int length)