Package io.protostuff
Class GraphByteArrayInput
- All Implemented Interfaces:
GraphInput
,Input
,Schema<Object>
public final class GraphByteArrayInput
extends FilterInput<ByteArrayInput>
implements GraphInput, Schema<Object>
A ByteArrayInput w/c can handle cyclic dependencies when deserializing objects with graph transformations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private boolean
Fields inherited from class io.protostuff.FilterInput
input
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFieldName
(int number) Gets the field name associated with the number.int
getFieldNumber
(String name) Gets the field number associated with the name.<T> void
handleUnknownField
(int fieldNumber, Schema<T> schema) The underlying implementation should handle the unknown field.boolean
Returns true if the last message was read as a reference.boolean
isInitialized
(Object owner) Returns true if there is no required field or if all the required fields are set.void
Deserializes a message/object from theinput
.<T> T
mergeObject
(T value, Schema<T> schema) Merges an object(with schema) field value.Returns the full name of the message tied to this schema.Returns the simple name of the message tied to this schema.Creates the message/object tied to this schema.<T> int
readFieldNumber
(Schema<T> schema) Reads the field number of a message/object tied to the givenschema
.Gets the class of the message.void
updateLast
(Object morphedMessage, Object lastMessage) Updates the last reference (the tip/end of the index) kept if thelastMessage
was indeed the last message.void
Serializes a message/object to theoutput
.Methods inherited from class io.protostuff.FilterInput
readBool, readByteArray, readByteBuffer, readBytes, readBytes, readDouble, readEnum, readFixed32, readFixed64, readFloat, readInt32, readInt64, readSFixed32, readSFixed64, readSInt32, readSInt64, readString, readUInt32, readUInt64, transferByteRangeTo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.protostuff.Input
readBool, readByteArray, readByteBuffer, readBytes, readBytes, readDouble, readEnum, readFixed32, readFixed64, readFloat, readInt32, readInt64, readSFixed32, readSFixed64, readSInt32, readSInt64, readString, readUInt32, readUInt64, transferByteRangeTo
-
Field Details
-
references
-
lastRef
private int lastRef -
lastSchema
-
messageReference
private boolean messageReference
-
-
Constructor Details
-
GraphByteArrayInput
-
GraphByteArrayInput
-
-
Method Details
-
updateLast
Description copied from interface:GraphInput
Updates the last reference (the tip/end of the index) kept if thelastMessage
was indeed the last message.- Specified by:
updateLast
in interfaceGraphInput
-
isCurrentMessageReference
public boolean isCurrentMessageReference()Description copied from interface:GraphInput
Returns true if the last message was read as a reference.- Specified by:
isCurrentMessageReference
in interfaceGraphInput
-
readFieldNumber
Description copied from interface:Input
Reads the field number of a message/object tied to the givenschema
.- Specified by:
readFieldNumber
in interfaceInput
- Overrides:
readFieldNumber
in classFilterInput<ByteArrayInput>
- Throws:
IOException
-
mergeObject
Description copied from interface:Input
Merges an object(with schema) field value. The providedschema
handles the deserialization for the object.- Specified by:
mergeObject
in interfaceInput
- Overrides:
mergeObject
in classFilterInput<ByteArrayInput>
- Throws:
IOException
-
handleUnknownField
Description copied from interface:Input
The underlying implementation should handle the unknown field.- Specified by:
handleUnknownField
in interfaceInput
- Overrides:
handleUnknownField
in classFilterInput<ByteArrayInput>
- Throws:
IOException
-
getFieldName
Description copied from interface:Schema
Gets the field name associated with the number. This is particularly useful when serializing to different formats (Eg. JSON). When using numeric field names:return String.valueOf(number);
- Specified by:
getFieldName
in interfaceSchema<Object>
-
getFieldNumber
Description copied from interface:Schema
Gets the field number associated with the name. This is particularly useful when serializing to different formats (Eg. JSON). When using numeric field names:return Integer.parseInt(name);
- Specified by:
getFieldNumber
in interfaceSchema<Object>
-
isInitialized
Description copied from interface:Schema
Returns true if there is no required field or if all the required fields are set.- Specified by:
isInitialized
in interfaceSchema<Object>
-
messageFullName
Description copied from interface:Schema
Returns the full name of the message tied to this schema. Allows custom schemas to provide a custom name other than typeClass().getName();- Specified by:
messageFullName
in interfaceSchema<Object>
-
messageName
Description copied from interface:Schema
Returns the simple name of the message tied to this schema. Allows custom schemas to provide a custom name other than typeClass().getSimpleName();- Specified by:
messageName
in interfaceSchema<Object>
-
newMessage
Description copied from interface:Schema
Creates the message/object tied to this schema.- Specified by:
newMessage
in interfaceSchema<Object>
-
typeClass
Description copied from interface:Schema
Gets the class of the message. -
mergeFrom
Description copied from interface:Schema
Deserializes a message/object from theinput
.- Specified by:
mergeFrom
in interfaceSchema<Object>
- Throws:
IOException
-
writeTo
Description copied from interface:Schema
Serializes a message/object to theoutput
.- Specified by:
writeTo
in interfaceSchema<Object>
- Throws:
IOException
-