Class NumericIdStrategy
java.lang.Object
io.protostuff.runtime.IdStrategy
io.protostuff.runtime.NumericIdStrategy
- Direct Known Subclasses:
ExplicitIdStrategy, IncrementalIdStrategy
Base class for numeric id strategies.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classstatic interfaceRegister your pojos/enums/collections/maps/delegates here.Nested classes/interfaces inherited from class IdStrategy
IdStrategy.Factory, IdStrategy.UnknownTypeException, IdStrategy.Wrapper -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intFields inherited from class IdStrategy
ARRAY_BIGDECIMAL_SCHEMA, ARRAY_BIGINTEGER_SCHEMA, ARRAY_BOOL_BOXED_SCHEMA, ARRAY_BOOL_DERIVED_SCHEMA, ARRAY_BOOL_PRIMITIVE_SCHEMA, ARRAY_BYTEARRAY_SCHEMA, ARRAY_BYTESTRING_SCHEMA, ARRAY_CHAR_BOXED_SCHEMA, ARRAY_CHAR_DERIVED_SCHEMA, ARRAY_CHAR_PRIMITIVE_SCHEMA, ARRAY_DATE_SCHEMA, ARRAY_DOUBLE_BOXED_SCHEMA, ARRAY_DOUBLE_DERIVED_SCHEMA, ARRAY_DOUBLE_PRIMITIVE_SCHEMA, ARRAY_ELEMENT_SCHEMA, ARRAY_FLOAT_BOXED_SCHEMA, ARRAY_FLOAT_DERIVED_SCHEMA, ARRAY_FLOAT_PRIMITIVE_SCHEMA, ARRAY_INT32_BOXED_SCHEMA, ARRAY_INT32_DERIVED_SCHEMA, ARRAY_INT32_PRIMITIVE_SCHEMA, ARRAY_INT64_BOXED_SCHEMA, ARRAY_INT64_DERIVED_SCHEMA, ARRAY_INT64_PRIMITIVE_SCHEMA, ARRAY_PIPE_SCHEMA, ARRAY_SCHEMA, ARRAY_SHORT_BOXED_SCHEMA, ARRAY_SHORT_DERIVED_SCHEMA, ARRAY_SHORT_PRIMITIVE_SCHEMA, ARRAY_STRING_SCHEMA, AUTO_LOAD_POLYMORPHIC_CLASSES, CLASS_ELEMENT_SCHEMA, CLASS_PIPE_SCHEMA, CLASS_SCHEMA, COLLECTION_PIPE_SCHEMA, COLLECTION_SCHEMA, COLLECTION_SCHEMA_ON_REPEATED_FIELDS, DEFAULT_FLAGS, DYNAMIC_VALUE_PIPE_SCHEMA, DYNAMIC_VALUE_SCHEMA, ENTRY_PIPE_SCHEMA, ENTRY_SCHEMA, ENUMS_BY_NAME, flags, groupId, MAP_PIPE_SCHEMA, MAP_SCHEMA, MORPH_COLLECTION_INTERFACES, MORPH_MAP_INTERFACES, MORPH_NON_FINAL_POJOS, NUMBER_ELEMENT_SCHEMA, OBJECT_ELEMENT_SCHEMA, OBJECT_PIPE_SCHEMA, OBJECT_SCHEMA, POJO_SCHEMA_ON_COLLECTION_FIELDS, POJO_SCHEMA_ON_MAP_FIELDS, POLYMORPHIC_COLLECTION_PIPE_SCHEMA, POLYMORPHIC_COLLECTION_SCHEMA, POLYMORPHIC_ENUM_ELEMENT_SCHEMA, POLYMORPHIC_MAP_PIPE_SCHEMA, POLYMORPHIC_MAP_SCHEMA, POLYMORPHIC_POJO_ELEMENT_SCHEMA, POLYMORPHIC_THROWABLE_ELEMENT_SCHEMA, PRESERVE_NULL_ELEMENTS, preserveNull, primaryGroup -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNumericIdStrategy(int flags, IdStrategy primaryGroup, int groupId) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Class<?> collectionClass(int id) protected abstract Class<?> delegateClass(int id) protected abstract Class<?> enumClass(int id) protected abstract intprotected abstract intprivate static intgetPrimitiveOrScalarId(Class<?> clazz, int id) protected abstract NumericIdStrategy.RegisteredDelegate<?> getRegisteredDelegate(Class<?> clazz) protected static <T> voidprotected abstract Class<?> mapClass(int id) protected static <T> ArrayList<T> newList(int size) protected abstract Class<?> pojoClass(int id) protected Class<?> resolveArrayComponentTypeFrom(Input input, boolean mapped) private Class<?> resolveClass(int id) protected Class<?> resolveClassFrom(Input input, boolean mapped, boolean array) protected voidtransferArrayId(Input input, Output output, int fieldNumber, boolean mapped) protected voidtransferClassId(Input input, Output output, int fieldNumber, boolean mapped, boolean array) protected voidwriteArrayIdTo(Output output, Class<?> componentType) protected voidwriteClassIdTo(Output output, Class<?> componentType, boolean array) Methods inherited from class IdStrategy
createMessageInstance, getCollectionFactory, getDelegate, getDelegateWrapper, getEnumIO, getMapFactory, getSchemaWrapper, isDelegateRegistered, isRegistered, newSchema, resolveCollectionFrom, resolveDelegateFrom, resolveEnumFrom, resolveMapFrom, resolvePojoFrom, transferCollectionId, transferDelegateId, transferEnumId, transferMapId, transferPojoId, tryWriteDelegateIdTo, tryWritePojoIdTo, writeCollectionIdTo, writeEnumIdTo, writeMapIdTo, writeMessageIdTo, writePojoIdTo
-
Field Details
-
CID_BOOL
protected static final int CID_BOOL- See Also:
-
CID_BYTE
protected static final int CID_BYTE- See Also:
-
CID_CHAR
protected static final int CID_CHAR- See Also:
-
CID_SHORT
protected static final int CID_SHORT- See Also:
-
CID_INT32
protected static final int CID_INT32- See Also:
-
CID_INT64
protected static final int CID_INT64- See Also:
-
CID_FLOAT
protected static final int CID_FLOAT- See Also:
-
CID_DOUBLE
protected static final int CID_DOUBLE- See Also:
-
CID_STRING
protected static final int CID_STRING- See Also:
-
CID_BYTES
protected static final int CID_BYTES- See Also:
-
CID_BYTE_ARRAY
protected static final int CID_BYTE_ARRAY- See Also:
-
CID_BIGDECIMAL
protected static final int CID_BIGDECIMAL- See Also:
-
CID_BIGINTEGER
protected static final int CID_BIGINTEGER- See Also:
-
CID_DATE
protected static final int CID_DATE- See Also:
-
CID_OBJECT
protected static final int CID_OBJECT- See Also:
-
CID_ENUM_SET
protected static final int CID_ENUM_SET- See Also:
-
CID_ENUM_MAP
protected static final int CID_ENUM_MAP- See Also:
-
CID_ENUM
protected static final int CID_ENUM- See Also:
-
CID_COLLECTION
protected static final int CID_COLLECTION- See Also:
-
CID_MAP
protected static final int CID_MAP- See Also:
-
CID_POJO
protected static final int CID_POJO- See Also:
-
CID_CLASS
protected static final int CID_CLASS- See Also:
-
CID_DELEGATE
protected static final int CID_DELEGATE- See Also:
-
-
Constructor Details
-
NumericIdStrategy
-
-
Method Details
-
writeArrayIdTo
- Specified by:
writeArrayIdToin classIdStrategy- Throws:
IOException
-
transferArrayId
protected void transferArrayId(Input input, Output output, int fieldNumber, boolean mapped) throws IOException - Specified by:
transferArrayIdin classIdStrategy- Throws:
IOException
-
resolveArrayComponentTypeFrom
- Specified by:
resolveArrayComponentTypeFromin classIdStrategy- Throws:
IOException
-
writeClassIdTo
protected void writeClassIdTo(Output output, Class<?> componentType, boolean array) throws IOException - Specified by:
writeClassIdToin classIdStrategy- Throws:
IOException
-
transferClassId
protected void transferClassId(Input input, Output output, int fieldNumber, boolean mapped, boolean array) throws IOException - Specified by:
transferClassIdin classIdStrategy- Throws:
IOException
-
resolveClassFrom
- Specified by:
resolveClassFromin classIdStrategy- Throws:
IOException
-
getPrimitiveOrScalarId
-
resolveClass
-
getRegisteredDelegate
-
enumClass
-
delegateClass
-
collectionClass
-
mapClass
-
pojoClass
-
getEnumId
-
getId
-
newList
-
grow
-