|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.dyuproject.protostuff.runtime.IdStrategy
com.dyuproject.protostuff.runtime.DefaultIdStrategy
public final class DefaultIdStrategy
The FQCN(fully qualified class name) will serve as the id (string). Does not need any registration in the user-code (works out-of-the-box). The size of serialized representation may be not very efficient.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.dyuproject.protostuff.runtime.IdStrategy |
|---|
IdStrategy.Factory, IdStrategy.UnknownTypeException |
| Constructor Summary | |
|---|---|
DefaultIdStrategy()
|
|
| Method Summary | ||
|---|---|---|
protected CollectionSchema.MessageFactory |
getCollectionFactory(java.lang.Class<?> clazz)
Returns the CollectionSchema.MessageFactory. |
|
protected EnumIO<? extends java.lang.Enum<?>> |
getEnumIO(java.lang.Class<?> enumClass)
Returns the EnumIO. |
|
protected MapSchema.MessageFactory |
getMapFactory(java.lang.Class<?> clazz)
Returns the MapSchema.MessageFactory. |
|
|
getSchemaWrapper(java.lang.Class<T> typeClass,
boolean create)
Returns the schema wrapper. |
|
boolean |
isRegistered(java.lang.Class<?> typeClass)
Returns true if the typeClass is explicitly registered. |
|
|
map(java.lang.Class<? super T> baseClass,
java.lang.Class<T> typeClass)
Used by RuntimeSchema.map(Class, Class). |
|
|
register(java.lang.Class<T> typeClass,
Schema<T> schema)
Used by RuntimeSchema.register(Class, Schema). |
|
protected java.lang.Class<?> |
resolveArrayComponentTypeFrom(Input input,
boolean nonConcrete)
|
|
protected CollectionSchema.MessageFactory |
resolveCollectionFrom(Input input)
|
|
protected EnumIO<?> |
resolveEnumFrom(Input input)
|
|
protected MapSchema.MessageFactory |
resolveMapFrom(Input input)
|
|
protected
|
resolvePojoFrom(Input input,
int fieldNumber)
|
|
protected void |
transferArrayId(Input input,
Output output,
int fieldNumber,
boolean nonConcrete)
|
|
protected void |
transferCollectionId(Input input,
Output output,
int fieldNumber)
|
|
protected void |
transferEnumId(Input input,
Output output,
int fieldNumber)
|
|
protected void |
transferMapId(Input input,
Output output,
int fieldNumber)
|
|
protected
|
transferPojoId(Input input,
Output output,
int fieldNumber)
|
|
protected void |
writeArrayIdTo(Output output,
java.lang.Class<?> componentType)
|
|
protected void |
writeCollectionIdTo(Output output,
int fieldNumber,
java.lang.Class<?> clazz)
|
|
protected void |
writeEnumIdTo(Output output,
int fieldNumber,
java.lang.Class<?> clazz)
|
|
protected void |
writeMapIdTo(Output output,
int fieldNumber,
java.lang.Class<?> clazz)
|
|
protected
|
writeMessageIdTo(Output output,
int fieldNumber,
Message<T> message)
|
|
protected
|
writePojoIdTo(Output output,
int fieldNumber,
java.lang.Class<T> clazz)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultIdStrategy()
| Method Detail |
|---|
public <T> boolean register(java.lang.Class<T> typeClass,
Schema<T> schema)
RuntimeSchema.register(Class, Schema).
public <T> boolean map(java.lang.Class<? super T> baseClass,
java.lang.Class<T> typeClass)
RuntimeSchema.map(Class, Class).
public boolean isRegistered(java.lang.Class<?> typeClass)
IdStrategytypeClass is explicitly registered.
isRegistered in class IdStrategy
public <T> HasSchema<T> getSchemaWrapper(java.lang.Class<T> typeClass,
boolean create)
IdStrategyschema wrapper.
The caller is responsible that the typeClass is a pojo (e.g not an enum/array/etc).
getSchemaWrapper in class IdStrategyprotected EnumIO<? extends java.lang.Enum<?>> getEnumIO(java.lang.Class<?> enumClass)
IdStrategyEnumIO.
The callers (internal field factories) are responsible that the class provided
is an enum class.
getEnumIO in class IdStrategyprotected CollectionSchema.MessageFactory getCollectionFactory(java.lang.Class<?> clazz)
IdStrategyCollectionSchema.MessageFactory.
The callers (internal field factories) are responsible that the class provided
implements Collection.
getCollectionFactory in class IdStrategyprotected MapSchema.MessageFactory getMapFactory(java.lang.Class<?> clazz)
IdStrategyMapSchema.MessageFactory.
The callers (internal field factories}) are responsible that the class provided
implements .
getMapFactory in class IdStrategy
protected void writeCollectionIdTo(Output output,
int fieldNumber,
java.lang.Class<?> clazz)
throws java.io.IOException
writeCollectionIdTo in class IdStrategyjava.io.IOException
protected void transferCollectionId(Input input,
Output output,
int fieldNumber)
throws java.io.IOException
transferCollectionId in class IdStrategyjava.io.IOException
protected CollectionSchema.MessageFactory resolveCollectionFrom(Input input)
throws java.io.IOException
resolveCollectionFrom in class IdStrategyjava.io.IOException
protected void writeMapIdTo(Output output,
int fieldNumber,
java.lang.Class<?> clazz)
throws java.io.IOException
writeMapIdTo in class IdStrategyjava.io.IOException
protected void transferMapId(Input input,
Output output,
int fieldNumber)
throws java.io.IOException
transferMapId in class IdStrategyjava.io.IOException
protected MapSchema.MessageFactory resolveMapFrom(Input input)
throws java.io.IOException
resolveMapFrom in class IdStrategyjava.io.IOException
protected void writeEnumIdTo(Output output,
int fieldNumber,
java.lang.Class<?> clazz)
throws java.io.IOException
writeEnumIdTo in class IdStrategyjava.io.IOException
protected void transferEnumId(Input input,
Output output,
int fieldNumber)
throws java.io.IOException
transferEnumId in class IdStrategyjava.io.IOException
protected EnumIO<?> resolveEnumFrom(Input input)
throws java.io.IOException
resolveEnumFrom in class IdStrategyjava.io.IOException
protected <T> Schema<T> writePojoIdTo(Output output,
int fieldNumber,
java.lang.Class<T> clazz)
throws java.io.IOException
writePojoIdTo in class IdStrategyjava.io.IOException
protected <T> HasSchema<T> transferPojoId(Input input,
Output output,
int fieldNumber)
throws java.io.IOException
transferPojoId in class IdStrategyjava.io.IOException
protected <T> HasSchema<T> resolvePojoFrom(Input input,
int fieldNumber)
throws java.io.IOException
resolvePojoFrom in class IdStrategyjava.io.IOException
protected <T> Schema<T> writeMessageIdTo(Output output,
int fieldNumber,
Message<T> message)
throws java.io.IOException
writeMessageIdTo in class IdStrategyjava.io.IOException
protected void writeArrayIdTo(Output output,
java.lang.Class<?> componentType)
throws java.io.IOException
writeArrayIdTo in class IdStrategyjava.io.IOException
protected void transferArrayId(Input input,
Output output,
int fieldNumber,
boolean nonConcrete)
throws java.io.IOException
transferArrayId in class IdStrategyjava.io.IOException
protected java.lang.Class<?> resolveArrayComponentTypeFrom(Input input,
boolean nonConcrete)
throws java.io.IOException
resolveArrayComponentTypeFrom in class IdStrategyjava.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||