public class OxmSerializer extends Object implements InitializingBean, RedisSerializer<Object>
Marshaller
and Unmarshaller. Note: null objects are serialized as empty arrays and vice versa.| Constructor and Description |
|---|
OxmSerializer()
Creates a new, uninitialized
OxmSerializer. |
OxmSerializer(Marshaller marshaller,
Unmarshaller unmarshaller)
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
Object |
deserialize(byte[] bytes)
Deserialize an object from the given binary data.
|
byte[] |
serialize(Object t)
Serialize the given object to binary data.
|
void |
setMarshaller(Marshaller marshaller) |
void |
setUnmarshaller(Unmarshaller unmarshaller) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbyteArray, canSerialize, getTargetType, java, java, json, stringpublic OxmSerializer()
OxmSerializer. Requires setMarshaller(Marshaller) and
setUnmarshaller(Unmarshaller) to be set before this serializer can be used.public OxmSerializer(Marshaller marshaller, Unmarshaller unmarshaller)
marshaller - must not be null.unmarshaller - must not be null.public void setMarshaller(Marshaller marshaller)
marshaller - The marshaller to set.public void setUnmarshaller(Unmarshaller unmarshaller)
unmarshaller - The unmarshaller to set.public void afterPropertiesSet()
afterPropertiesSet in interface InitializingBeanpublic Object deserialize(@Nullable byte[] bytes) throws SerializationException
RedisSerializerdeserialize in interface RedisSerializer<Object>bytes - object binary representation. Can be null.SerializationExceptionpublic byte[] serialize(@Nullable Object t) throws SerializationException
RedisSerializerserialize in interface RedisSerializer<Object>t - object to serialize. Can be null.SerializationExceptionCopyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.