public class LegacySerializationPolicy extends SerializationPolicy implements TypeNameObfuscator
The set of allowed types are:
IsSerializable
Types that derive from Serializable
but do not meet any of the above
criteria may not be serialized as leaf types. However, their fields may be
serialized as super types of a legal type.
SERVICE_INTERFACE_ID
Modifier and Type | Method and Description |
---|---|
String |
getClassNameForTypeId(String id)
Implemented to fail with a useful error message.
|
static LegacySerializationPolicy |
getInstance() |
String |
getTypeIdForClass(Class<?> clazz)
Implemented to fail with a useful error message.
|
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.
|
getClientFieldNamesForEnhancedClass
public static LegacySerializationPolicy getInstance()
public final String getClassNameForTypeId(String id) throws SerializationException
getClassNameForTypeId
in interface TypeNameObfuscator
id
- 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 final String getTypeIdForClass(Class<?> clazz) throws SerializationException
getTypeIdForClass
in interface TypeNameObfuscator
clazz
- the class to be transmittedSerializationException
public boolean shouldDeserializeFields(Class<?> clazz)
SerializationPolicy
true
if the class' fields should be deserialized.shouldDeserializeFields
in class SerializationPolicy
clazz
- the class to testtrue
if the class' fields should be deserializedpublic boolean shouldSerializeFields(Class<?> clazz)
SerializationPolicy
true
if the class' fields should be serialized.shouldSerializeFields
in class SerializationPolicy
clazz
- the class to testtrue
if the class' fields should be serializedpublic void validateDeserialize(Class<?> clazz) throws SerializationException
SerializationPolicy
validateDeserialize
in class SerializationPolicy
clazz
- the class to validateSerializationException
- if the class is not allowed to be
deserializedpublic void validateSerialize(Class<?> clazz) throws SerializationException
SerializationPolicy
validateSerialize
in class SerializationPolicy
clazz
- the class to validateSerializationException
- if the class is not allowed to be serializedCopyright © 2018. All rights reserved.