Package io.protostuff.runtime
Class ObjectSchema
java.lang.Object
io.protostuff.runtime.PolymorphicSchema
io.protostuff.runtime.ObjectSchema
A schema for dynamic types (fields where the type is
Object
).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
An array wrapper internally used for adding objects.Nested classes/interfaces inherited from class io.protostuff.runtime.PolymorphicSchema
PolymorphicSchema.Factory, PolymorphicSchema.Handler
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
(package private) static final int
(package private) static final int
protected final Pipe.Schema
<Object> Fields inherited from class io.protostuff.runtime.PolymorphicSchema
strategy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static Class
<?> getArrayClass
(Input input, Schema<?> schema, Class<?> componentType) getFieldName
(int number) Gets the field name associated with the number.int
getFieldNumber
(String name) Gets the field number associated with the name.The pipe schema associated with this schema.private static boolean
isComponentPojo
(Class<?> componentType) void
Deserializes a message/object from theinput
.Returns the full name of the message tied to this schema.Returns the simple name of the message tied to this schema.(package private) static String
name
(int number) (package private) static ObjectSchema.ArrayWrapper
newArrayWrapper
(Input input, Schema<?> schema, boolean mapped, IdStrategy strategy) (package private) static int
(package private) static Object
readObjectFrom
(Input input, Schema<?> schema, Object owner, IdStrategy strategy) (package private) static void
transferArray
(Pipe pipe, Input input, Output output, int number, Pipe.Schema<?> pipeSchema, boolean mapped, IdStrategy strategy) (package private) static void
transferClass
(Pipe pipe, Input input, Output output, int number, Pipe.Schema<?> pipeSchema, boolean mapped, boolean array, IdStrategy strategy) (package private) static void
transferObject
(Pipe.Schema<Object> pipeSchema, Pipe pipe, Input input, Output output, IdStrategy strategy) private static void
writeArrayTo
(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy, Class<Object> clazz) private static void
writeComponentTo
(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy, Class<?> componentType, int dimensions) (package private) static void
writeObjectTo
(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy) void
Serializes a message/object to theoutput
.Methods inherited from class io.protostuff.runtime.PolymorphicSchema
isInitialized, newMessage, setValue, typeClass
-
Field Details
-
ID_ENUM_VALUE
static final int ID_ENUM_VALUE- See Also:
-
ID_ARRAY_LEN
static final int ID_ARRAY_LEN- See Also:
-
ID_ARRAY_DIMENSION
static final int ID_ARRAY_DIMENSION- See Also:
-
pipeSchema
-
-
Constructor Details
-
ObjectSchema
-
-
Method Details
-
name
-
number
-
getPipeSchema
Description copied from class:PolymorphicSchema
The pipe schema associated with this schema.- Specified by:
getPipeSchema
in classPolymorphicSchema
-
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);
-
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);
-
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
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(); -
mergeFrom
Description copied from interface:Schema
Deserializes a message/object from theinput
.- Throws:
IOException
-
writeTo
Description copied from interface:Schema
Serializes a message/object to theoutput
.- Throws:
IOException
-
newArrayWrapper
static ObjectSchema.ArrayWrapper newArrayWrapper(Input input, Schema<?> schema, boolean mapped, IdStrategy strategy) throws IOException - Throws:
IOException
-
transferArray
static void transferArray(Pipe pipe, Input input, Output output, int number, Pipe.Schema<?> pipeSchema, boolean mapped, IdStrategy strategy) throws IOException - Throws:
IOException
-
transferClass
static void transferClass(Pipe pipe, Input input, Output output, int number, Pipe.Schema<?> pipeSchema, boolean mapped, boolean array, IdStrategy strategy) throws IOException - Throws:
IOException
-
getArrayClass
static Class<?> getArrayClass(Input input, Schema<?> schema, Class<?> componentType) throws IOException - Throws:
IOException
-
readObjectFrom
static Object readObjectFrom(Input input, Schema<?> schema, Object owner, IdStrategy strategy) throws IOException - Throws:
IOException
-
writeObjectTo
static void writeObjectTo(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy) throws IOException - Throws:
IOException
-
isComponentPojo
-
writeComponentTo
private static void writeComponentTo(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy, Class<?> componentType, int dimensions) throws IOException - Throws:
IOException
-
writeArrayTo
private static void writeArrayTo(Output output, Object value, Schema<?> currentSchema, IdStrategy strategy, Class<Object> clazz) throws IOException - Throws:
IOException
-
transferObject
static void transferObject(Pipe.Schema<Object> pipeSchema, Pipe pipe, Input input, Output output, IdStrategy strategy) throws IOException - Throws:
IOException
-