T - is the implementation of the JsonNode like
ObjectNode or
ArrayNodepublic class JsonSerializer<T extends org.apache.tinkerpop.shaded.jackson.databind.JsonNode> extends Object implements OrderPreservingSerializer<T>
JsonNode by using
StringSerializer for JSON string serialization.
Throws JsonNodeParseException if the string has a wrong JSON format.| Constructor and Description |
|---|
JsonSerializer(Class<T> jsonType) |
| Modifier and Type | Method and Description |
|---|---|
T |
convert(Object value)
Converts the given (not-null) value to the expected data type V.
|
T |
read(ScanBuffer buffer)
Reads an attribute from the given ReadBuffer.
|
T |
readByteOrder(ScanBuffer buffer)
Reads an attribute from the given ReadBuffer assuming it was written in byte order.
|
void |
verifyAttribute(T value)
Verifies the given (not-null) attribute value is valid.
|
void |
write(WriteBuffer buffer,
T attribute)
Writes the attribute value to the given WriteBuffer.
|
void |
writeByteOrder(WriteBuffer buffer,
T attribute)
Writes the attribute value to the given WriteBuffer such that the byte order of the result is equal to the
natural order of the attribute.
|
public T readByteOrder(ScanBuffer buffer)
OrderPreservingSerializerIt is expected that this read operation adjusts the position in the ReadBuffer to after the attribute value.
readByteOrder in interface OrderPreservingSerializer<T extends org.apache.tinkerpop.shaded.jackson.databind.JsonNode>buffer - ReadBuffer to read attribute frompublic void writeByteOrder(WriteBuffer buffer, T attribute)
OrderPreservingSerializerIt is expected that this write operation adjusts the position in the WriteBuffer to after the attribute value.
writeByteOrder in interface OrderPreservingSerializer<T extends org.apache.tinkerpop.shaded.jackson.databind.JsonNode>buffer - WriteBuffer to write attribute toattribute - Attribute to write to WriteBufferpublic T read(ScanBuffer buffer)
AttributeSerializerIt is expected that this read operation adjusts the position in the ReadBuffer to after the attribute value.
read in interface AttributeSerializer<T extends org.apache.tinkerpop.shaded.jackson.databind.JsonNode>buffer - ReadBuffer to read attribute frompublic void write(WriteBuffer buffer, T attribute)
AttributeSerializerIt is expected that this write operation adjusts the position in the WriteBuffer to after the attribute value.
write in interface AttributeSerializer<T extends org.apache.tinkerpop.shaded.jackson.databind.JsonNode>buffer - WriteBuffer to write attribute toattribute - Attribute to write to WriteBufferpublic void verifyAttribute(T value)
AttributeSerializerIllegalArgumentException if the value is invalid,
otherwise simply returns.verifyAttribute in interface AttributeSerializer<T extends org.apache.tinkerpop.shaded.jackson.databind.JsonNode>value - to verifypublic T convert(Object value)
AttributeSerializerIllegalArgumentException if it cannot be converted.convert in interface AttributeSerializer<T extends org.apache.tinkerpop.shaded.jackson.databind.JsonNode>value - to convertCopyright © 2012–2023. All rights reserved.