Package io.protostuff.runtime
Class RuntimeDerivativeField<T>
- java.lang.Object
-
- io.protostuff.runtime.Field<T>
-
- io.protostuff.runtime.RuntimeDerivativeField<T>
-
abstract class RuntimeDerivativeField<T> extends Field<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
Fields Modifier and Type Field Description DerivativeSchema
schema
The schema of the polymorphic pojo.java.lang.Class<java.lang.Object>
typeClass
The class of the message field.
-
Constructor Summary
Constructors Constructor Description RuntimeDerivativeField(java.lang.Class<java.lang.Object> typeClass, WireFormat.FieldType type, int number, java.lang.String name, boolean repeated, Tag tag, IdStrategy strategy)
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description protected abstract void
doMergeFrom(Input input, Schema<java.lang.Object> derivedSchema, java.lang.Object owner)
-
-
-
Field Detail
-
schema
public final DerivativeSchema schema
The schema of the polymorphic pojo.
-
typeClass
public final java.lang.Class<java.lang.Object> typeClass
The class of the message field.
-
-
Constructor Detail
-
RuntimeDerivativeField
public RuntimeDerivativeField(java.lang.Class<java.lang.Object> typeClass, WireFormat.FieldType type, int number, java.lang.String name, boolean repeated, Tag tag, IdStrategy strategy)
-
-