Top Description Fields Constructors Methods
tools.jackson.databind.node

public Class BinaryNode

extends ValueNode
Class Inheritance
Imports
java.util.Arrays, .Objects, tools.jackson.core.*, tools.jackson.databind.SerializationContext

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
Inherited from tools.jackson.databind.node.ValueNode:
BD_MAX_INTEGERBD_MAX_LONGBD_MAX_SHORTBD_MIN_INTEGERBD_MIN_LONGBD_MIN_SHORTBI_MAX_INTEGERBI_MAX_LONGBI_MAX_SHORTBI_MIN_INTEGERBI_MIN_LONGBI_MIN_SHORTMISSING

Constructor Summary

AccessConstructor and Description
public
BinaryNode(byte[] data)

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

Method Summary

Modifier and TypeMethod and Description
protected String
protected String
_valueDesc()

Implements abstract tools.jackson.databind.node.BaseJsonNode._valueDesc.

Method for implementation classes to return a short description of contained value, to be used in error messages.

public JsonToken
asToken()

Implements abstract tools.jackson.databind.node.ValueNode.asToken.

Implements tools.jackson.core.TreeNode.asToken.

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

public byte[]
binaryValue()

Overrides tools.jackson.databind.node.BaseJsonNode.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 o)

Implements abstract tools.jackson.databind.JsonNode.equals.

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

public JsonNodeType
getNodeType()

Implements abstract tools.jackson.databind.JsonNode.getNodeType.

Return the type of this node

public int
hashCode()

Implements abstract tools.jackson.databind.node.BaseJsonNode.hashCode.

Returns a hash code value for this object.

public final void
serialize(JsonGenerator g, SerializationContext provider)

Implements abstract tools.jackson.databind.node.BaseJsonNode.serialize.

Implements tools.jackson.databind.JacksonSerializable.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 tools.jackson.databind.node.ValueNode:
_atdeepCopyfindParentfindParentsfindValuefindValuesfindValuesAsStringgetgethashashasNonNullhasNonNullisEmptypathpathserializeWithType

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 tools.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

_asStringback to summary
protected String _asString()

Overrides tools.jackson.databind.node.BaseJsonNode._asString.

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

Annotations
@Override
_valueDescback to summary
protected String _valueDesc()

Implements abstract tools.jackson.databind.node.BaseJsonNode._valueDesc.

Doc from tools.jackson.databind.node.BaseJsonNode._valueDesc.

Method for implementation classes to return a short description of contained value, to be used in error messages.

Annotations
@Override
asTokenback to summary
public JsonToken asToken()

Implements abstract tools.jackson.databind.node.ValueNode.asToken.

Implements tools.jackson.core.TreeNode.asToken.

Doc from tools.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)

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

Overrides tools.jackson.databind.node.BaseJsonNode.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.

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

Implements abstract tools.jackson.databind.JsonNode.equals.

Doc from tools.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.

Annotations
@Override
getNodeTypeback to summary
public JsonNodeType getNodeType()

Implements abstract tools.jackson.databind.JsonNode.getNodeType.

Doc from tools.jackson.databind.JsonNode.getNodeType.

Return the type of this node

Annotations
@Override
hashCodeback to summary
public int hashCode()

Implements abstract tools.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.
Annotations
@Override
serializeback to summary
public final void serialize(JsonGenerator g, SerializationContext provider) throws JacksonException

Implements abstract tools.jackson.databind.node.BaseJsonNode.serialize.

Implements tools.jackson.databind.JacksonSerializable.serialize.

Doc from tools.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)