Package io.protostuff.runtime
Class ArraySchemas.Base
- java.lang.Object
-
- io.protostuff.runtime.PolymorphicSchema
-
- io.protostuff.runtime.ArraySchemas.Base
-
- All Implemented Interfaces:
Schema<java.lang.Object>
- Direct Known Subclasses:
ArraySchemas.BigDecimalArray
,ArraySchemas.BigIntegerArray
,ArraySchemas.BoolArray
,ArraySchemas.ByteArrayArray
,ArraySchemas.ByteStringArray
,ArraySchemas.CharArray
,ArraySchemas.DateArray
,ArraySchemas.DelegateArray
,ArraySchemas.DoubleArray
,ArraySchemas.EnumArray
,ArraySchemas.FloatArray
,ArraySchemas.Int32Array
,ArraySchemas.Int64Array
,ArraySchemas.PojoArray
,ArraySchemas.ShortArray
,ArraySchemas.StringArray
- Enclosing class:
- ArraySchemas
public abstract static class ArraySchemas.Base extends PolymorphicSchema
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.protostuff.runtime.PolymorphicSchema
PolymorphicSchema.Factory, PolymorphicSchema.Handler
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
allowNullArrayElement
protected PolymorphicSchema.Handler
handler
-
Fields inherited from class io.protostuff.runtime.PolymorphicSchema
strategy
-
-
Constructor Summary
Constructors Constructor Description Base(IdStrategy strategy, PolymorphicSchema.Handler handler)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String
getFieldName(int number)
Gets the field name associated with the number.int
getFieldNumber(java.lang.String name)
Gets the field number associated with the name.void
mergeFrom(Input input, java.lang.Object owner)
Deserializes a message/object from theinput
.java.lang.String
messageFullName()
Returns the full name of the message tied to this schema.java.lang.String
messageName()
Returns the simple name of the message tied to this schema.protected abstract java.lang.Object
readFrom(Input input, java.lang.Object owner)
protected void
setValue(java.lang.Object value, java.lang.Object owner)
Set the value to the owner.-
Methods inherited from class io.protostuff.runtime.PolymorphicSchema
getPipeSchema, isInitialized, newMessage, typeClass
-
-
-
-
Field Detail
-
handler
protected final PolymorphicSchema.Handler handler
-
allowNullArrayElement
protected final boolean allowNullArrayElement
-
-
Constructor Detail
-
Base
public Base(IdStrategy strategy, PolymorphicSchema.Handler handler)
-
-
Method Detail
-
getFieldName
public java.lang.String getFieldName(int number)
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);
-
getFieldNumber
public int getFieldNumber(java.lang.String name)
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);
-
messageFullName
public java.lang.String 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();
-
messageName
public java.lang.String 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();
-
setValue
protected void setValue(java.lang.Object value, java.lang.Object owner)
Description copied from class:PolymorphicSchema
Set the value to the owner.- Specified by:
setValue
in classPolymorphicSchema
-
mergeFrom
public void mergeFrom(Input input, java.lang.Object owner) throws java.io.IOException
Description copied from interface:Schema
Deserializes a message/object from theinput
.- Throws:
java.io.IOException
-
readFrom
protected abstract java.lang.Object readFrom(Input input, java.lang.Object owner) throws java.io.IOException
- Throws:
java.io.IOException
-
-