public class TreeMap_ServerCustomFieldSerializer extends ServerCustomFieldSerializer<TreeMap>
TreeMap
.Constructor and Description |
---|
TreeMap_ServerCustomFieldSerializer() |
Modifier and Type | Method and Description |
---|---|
static void |
deserialize(ServerSerializationStreamReader streamReader,
TreeMap instance,
Type[] expectedParameterTypes,
DequeMap<TypeVariable<?>,Type> resolvedTypes) |
void |
deserializeInstance(SerializationStreamReader streamReader,
TreeMap instance)
Deserializes the content of the object from the
SerializationStreamReader . |
void |
deserializeInstance(ServerSerializationStreamReader streamReader,
TreeMap instance,
Type[] expectedParameterTypes,
DequeMap<TypeVariable<?>,Type> resolvedTypes)
Deserializes the content of the object from the
ServerSerializationStreamReader , with type checking. |
boolean |
hasCustomInstantiateInstance() |
static TreeMap |
instantiate(ServerSerializationStreamReader streamReader,
Type[] expectedParameterTypes,
DequeMap<TypeVariable<?>,Type> resolvedTypes) |
TreeMap |
instantiateInstance(SerializationStreamReader streamReader)
Instantiates an object from the
SerializationStreamReader . |
TreeMap |
instantiateInstance(ServerSerializationStreamReader streamReader,
Type[] expectedParameterTypes,
DequeMap<TypeVariable<?>,Type> resolvedTypes)
Instantiates an object from the
ServerSerializationStreamReader ,
with type checking. |
void |
serializeInstance(SerializationStreamWriter streamWriter,
TreeMap instance)
Serializes the content of the object into the
SerializationStreamWriter . |
instantiateInstance
public static void deserialize(ServerSerializationStreamReader streamReader, TreeMap instance, Type[] expectedParameterTypes, DequeMap<TypeVariable<?>,Type> resolvedTypes) throws SerializationException
SerializationException
public static TreeMap instantiate(ServerSerializationStreamReader streamReader, Type[] expectedParameterTypes, DequeMap<TypeVariable<?>,Type> resolvedTypes) throws SerializationException
SerializationException
public void deserializeInstance(SerializationStreamReader streamReader, TreeMap instance) throws SerializationException
CustomFieldSerializer
SerializationStreamReader
.deserializeInstance
in class CustomFieldSerializer<TreeMap>
streamReader
- the SerializationStreamReader
to read the
object's content frominstance
- the object instance to deserializeSerializationException
- if the deserialization operation is not
successfulpublic void deserializeInstance(ServerSerializationStreamReader streamReader, TreeMap instance, Type[] expectedParameterTypes, DequeMap<TypeVariable<?>,Type> resolvedTypes) throws SerializationException
ServerCustomFieldSerializer
ServerSerializationStreamReader
, with type checking.
The calling code has verified that the instance this method is
deserializing is of the correct type for the RPC call. However, is has not
verified the objects that this deserializer will read. It is this method's
responsibility to verify the types of objects that it reads. Failure to
do so leaves the server vulnerable to an attacker who replaces
deserialized data in the RPC message with data that takes an exponential
time to deserialize or otherwise causes problems.
In practice, any call to ServerSerilizationStreamReader.readObject() should
use the type checking version, passing in the expected type of the object
to be read. For classes that deserialize objects of generic types, the
expectedParameterTypes array provides the type bound to each type
generic parameter defined by the instance. See the built-in GWT
server custom field serializers for examples.deserializeInstance
in class ServerCustomFieldSerializer<TreeMap>
streamReader
- the ServerSerializationStreamReader
to read the
object's content frominstance
- the object instance to deserializeexpectedParameterTypes
- the types we expect for any generic
parameters used by this class, in the order in which they
appear in the instance.getTypeParameters()resolvedTypes
- map from generic types to actual typesSerializationException
- if the deserialization operation is not
successfulpublic boolean hasCustomInstantiateInstance()
hasCustomInstantiateInstance
in class CustomFieldSerializer<TreeMap>
true
if a specialist CustomFieldSerializer.instantiateInstance(com.google.gwt.user.client.rpc.SerializationStreamReader)
is
implemented; false
otherwisepublic TreeMap instantiateInstance(SerializationStreamReader streamReader) throws SerializationException
CustomFieldSerializer
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 CustomFieldSerializer.hasCustomInstantiateInstance()
method
must return true
in order for the framework to know to call
it.
instantiateInstance
in class CustomFieldSerializer<TreeMap>
streamReader
- the SerializationStreamReader
to read the
object's content fromSerializationStreamReader
SerializationException
- if the instantiation operation is not
successfulpublic TreeMap instantiateInstance(ServerSerializationStreamReader streamReader, Type[] expectedParameterTypes, DequeMap<TypeVariable<?>,Type> resolvedTypes) throws SerializationException
ServerCustomFieldSerializer
ServerSerializationStreamReader
,
with type checking.
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
CustomFieldSerializer.hasCustomInstantiateInstance()
method must
return true
in order for the framework to know to call it.
The calling code has verified that the instance this method is
instantiating is of the correct type for the RPC call. However, is has not
verified the objects that this instantiator will read. It is this method's
responsibility to verify the types of objects that it reads. Failure to
do so leaves the server vulnerable to an attacker who replaces
deserialized data in the RPC message with data that takes an exponential
time to instantiate or otherwise causes problems.
In practice, any call to ServerSerilizationStreamReader.readObject() should
use the type checking version, passing in the expected type of the object
to be read. For classes that instantiate objects of generic types, the
expectedParameterTypes array provides the type bound to each type
generic parameter defined by the instance. See the built-in GWT
server custom field serializers for examples.
instantiateInstance
in class ServerCustomFieldSerializer<TreeMap>
streamReader
- the ServerSerializationStreamReader
to read the
object's content fromexpectedParameterTypes
- the types we expect for any generic
parameters used by this class, in the order returned by
instance.getTypeParameters()resolvedTypes
- map from generic types to actual typesServerSerializationStreamReader
SerializationException
- if the instantiation operation is not
successfulpublic void serializeInstance(SerializationStreamWriter streamWriter, TreeMap instance) throws SerializationException
CustomFieldSerializer
SerializationStreamWriter
.serializeInstance
in class CustomFieldSerializer<TreeMap>
streamWriter
- the SerializationStreamWriter
to write the
object's content toinstance
- the object instance to serializeSerializationException
- if the serialization operation is not
successfulCopyright © 2016. All rights reserved.