public class

StandardSerializationPolicy

extends SerializationPolicy
implements TypeNameObfuscator
java.lang.Object
   ↳ com.google.gwt.user.server.rpc.SerializationPolicy
     ↳ com.google.gwt.user.server.rpc.impl.StandardSerializationPolicy

Class Overview

Standard implementation of a SerializationPolicy.

Summary

[Expand]
Inherited Constants
From interface com.google.gwt.user.server.rpc.impl.TypeNameObfuscator
Public Constructors
StandardSerializationPolicy(Map<Class<?>, Boolean> serializationWhitelist, Map<Class<?>, Boolean> deserializationWhitelist, Map<Class<?>, String> obfuscatedTypeIds)
Constructs a SerializationPolicy from several Maps.
StandardSerializationPolicy(Map<Class<?>, Boolean> serializationWhitelist, Map<Class<?>, Boolean> deserializationWhitelist, Map<Class<?>, String> obfuscatedTypeIds, Map<Class<?>, Set<String>> clientFields)
Constructs a SerializationPolicy from several Maps.
Public Methods
final String getClassNameForTypeId(String id)
Returns the name of the class that should be instantiated based on an obfuscated identifier.
Set<String> getClientFieldNamesForEnhancedClass(Class<?> clazz)
Returns the field names of the given class known to the client for classes that are expected to be enhanced on the server to have additional fields, or null for classes that are not expected to be enhanced.
final String getTypeIdForClass(Class<?> clazz)
Returns the obfuscated identifier to be used to encode a class in the RPC wire format.
boolean shouldDeserializeFields(Class<?> clazz)
Returns true if the class' fields should be deserialized.
boolean shouldSerializeFields(Class<?> clazz)
Returns true if the class' fields should be serialized.
void validateDeserialize(Class<?> clazz)
Validates that the specified class should be deserialized from a stream.
void validateSerialize(Class<?> clazz)
Validates that the specified class should be serialized into a stream.
[Expand]
Inherited Methods
From class com.google.gwt.user.server.rpc.SerializationPolicy
From class java.lang.Object
From interface com.google.gwt.user.server.rpc.impl.TypeNameObfuscator

Public Constructors

public StandardSerializationPolicy (Map<Class<?>, Boolean> serializationWhitelist, Map<Class<?>, Boolean> deserializationWhitelist, Map<Class<?>, String> obfuscatedTypeIds)

Constructs a SerializationPolicy from several Maps.

public StandardSerializationPolicy (Map<Class<?>, Boolean> serializationWhitelist, Map<Class<?>, Boolean> deserializationWhitelist, Map<Class<?>, String> obfuscatedTypeIds, Map<Class<?>, Set<String>> clientFields)

Constructs a SerializationPolicy from several Maps.

Public Methods

public final String getClassNameForTypeId (String id)

Returns the name of the class that should be instantiated based on an obfuscated identifier.

Parameters
id the type id that was present in the RPC payload
Returns
  • the name of the class, suitable for use by forName(String), to be instantiated

public Set<String> getClientFieldNamesForEnhancedClass (Class<?> clazz)

Returns the field names of the given class known to the client for classes that are expected to be enhanced on the server to have additional fields, or null for classes that are not expected to be enhanced.

Parameters
clazz the class to test
Returns
  • a set containing client field names, or null

public final String getTypeIdForClass (Class<?> clazz)

Returns the obfuscated identifier to be used to encode a class in the RPC wire format.

Parameters
clazz the class to be transmitted
Returns
  • the obfuscated type identifier.

public boolean shouldDeserializeFields (Class<?> clazz)

Returns true if the class' fields should be deserialized.

Parameters
clazz the class to test
Returns
  • true if the class' fields should be deserialized

public boolean shouldSerializeFields (Class<?> clazz)

Returns true if the class' fields should be serialized.

Parameters
clazz the class to test
Returns
  • true if the class' fields should be serialized

public void validateDeserialize (Class<?> clazz)

Validates that the specified class should be deserialized from a stream.

Parameters
clazz the class to validate

public void validateSerialize (Class<?> clazz)

Validates that the specified class should be serialized into a stream.

Parameters
clazz the class to validate