Package io.protostuff.runtime
Class RuntimeDerivativeField<T>
java.lang.Object
io.protostuff.runtime.Field<T>
io.protostuff.runtime.RuntimeDerivativeField<T>
A runtime field w/c represents an abstract class, interface or a base type with many possible subclasses.
The type metadata is written for the deserializer to know the actual/exact schema to use upon deserialization.
Limitations: The number of fields are limited to 126 (127 is the usual limit anyway). The order of the fields being written must be preserved. It will not work if the message serialized is coming from the browser since the fields will most likey be out-of-order (unless you have control of the json serialization).
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal DerivativeSchema
The schema of the polymorphic pojo.The class of the message field. -
Constructor Summary
ConstructorsConstructorDescriptionRuntimeDerivativeField
(Class<Object> typeClass, WireFormat.FieldType type, int number, String name, boolean repeated, Tag tag, IdStrategy strategy) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
doMergeFrom
(Input input, Schema<Object> derivedSchema, Object owner)
-
Field Details
-
schema
The schema of the polymorphic pojo. -
typeClass
The class of the message field.
-
-
Constructor Details
-
RuntimeDerivativeField
public RuntimeDerivativeField(Class<Object> typeClass, WireFormat.FieldType type, int number, String name, boolean repeated, Tag tag, IdStrategy strategy)
-
-
Method Details
-
doMergeFrom
protected abstract void doMergeFrom(Input input, Schema<Object> derivedSchema, Object owner) throws IOException - Throws:
IOException
-