
public class StandardSerializationPolicy extends SerializationPolicy implements TypeNameObfuscator
SerializationPolicy.SERVICE_INTERFACE_ID| Constructor and Description |
|---|
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. |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.
|
public StandardSerializationPolicy(Map<Class<?>,Boolean> serializationWhitelist, Map<Class<?>,Boolean> deserializationWhitelist, Map<Class<?>,String> obfuscatedTypeIds)
SerializationPolicy from several Maps.public final String getClassNameForTypeId(String id) throws SerializationException
TypeNameObfuscatorgetClassNameForTypeId in interface TypeNameObfuscatorid - the type id that was present in the RPC payloadClass#forName,
to be instantiatedSerializationException - if there is no class that corresponds to the
obfuscated idpublic Set<String> getClientFieldNamesForEnhancedClass(Class<?> clazz)
SerializationPolicygetClientFieldNamesForEnhancedClass in class SerializationPolicyclazz - the class to testpublic final String getTypeIdForClass(Class<?> clazz) throws SerializationException
TypeNameObfuscatorgetTypeIdForClass in interface TypeNameObfuscatorclazz - the class to be transmittedSerializationExceptionpublic boolean shouldDeserializeFields(Class<?> clazz)
SerializationPolicytrue if the class' fields should be deserialized.shouldDeserializeFields in class SerializationPolicyclazz - the class to testtrue if the class' fields should be deserializedpublic boolean shouldSerializeFields(Class<?> clazz)
SerializationPolicytrue if the class' fields should be serialized.shouldSerializeFields in class SerializationPolicyclazz - the class to testtrue if the class' fields should be serializedpublic void validateDeserialize(Class<?> clazz) throws SerializationException
SerializationPolicyvalidateDeserialize in class SerializationPolicyclazz - the class to validateSerializationException - if the class is not allowed to be
deserializedpublic void validateSerialize(Class<?> clazz) throws SerializationException
SerializationPolicyvalidateSerialize in class SerializationPolicyclazz - the class to validateSerializationException - if the class is not allowed to be serializedCopyright © 2018. All rights reserved.