T
- the type of the object being serializedpublic abstract class CustomFieldSerializer<T> extends Object
Constructor and Description |
---|
CustomFieldSerializer() |
Modifier and Type | Method and Description |
---|---|
abstract void |
deserializeInstance(SerializationStreamReader streamReader,
T instance)
Deserializes the content of the object from the
SerializationStreamReader . |
boolean |
hasCustomInstantiateInstance() |
T |
instantiateInstance(SerializationStreamReader streamReader)
Instantiates an object from the
SerializationStreamReader . |
abstract void |
serializeInstance(SerializationStreamWriter streamWriter,
T instance)
Serializes the content of the object into the
SerializationStreamWriter . |
public abstract void deserializeInstance(SerializationStreamReader streamReader, T instance) throws SerializationException
SerializationStreamReader
.streamReader
- the SerializationStreamReader
to read the
object's content frominstance
- the object instance to deserializeSerializationException
- if the deserialization operation is not
successfulpublic boolean hasCustomInstantiateInstance()
true
if a specialist instantiateInstance(com.google.gwt.user.client.rpc.SerializationStreamReader)
is
implemented; false
otherwisepublic T instantiateInstance(SerializationStreamReader streamReader) throws SerializationException
SerializationStreamReader
.
Most of the time, this can be left unimplemented and the framework will instantiate the instance itself. This is typically used when the object being deserialized is immutable, hence it has to be created with its state already set.
If this is overridden, the hasCustomInstantiateInstance()
method
must return true
in order for the framework to know to call
it.
streamReader
- the SerializationStreamReader
to read the
object's content fromSerializationStreamReader
SerializationException
- if the instantiation operation is not
successfulpublic abstract void serializeInstance(SerializationStreamWriter streamWriter, T instance) throws SerializationException
SerializationStreamWriter
.streamWriter
- the SerializationStreamWriter
to write the
object's content toinstance
- the object instance to serializeSerializationException
- if the serialization operation is not
successfulCopyright © 2018. All rights reserved.