org.springframework.data.redis.serializer
Class OxmSerializer
java.lang.Object
org.springframework.data.redis.serializer.OxmSerializer
- All Implemented Interfaces:
- InitializingBean, RedisSerializer<Object>
public class OxmSerializer
- extends Object
- implements InitializingBean, RedisSerializer<Object>
Serializer adapter on top of Spring's O/X Mapping.
Delegates serialization/deserialization to OXM Marshaller and
Unmarshaller.
Note:Null objects are serialized as empty arrays and vice versa.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OxmSerializer
public OxmSerializer()
OxmSerializer
public OxmSerializer(Marshaller marshaller,
Unmarshaller unmarshaller)
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet in interface InitializingBean
setMarshaller
public void setMarshaller(Marshaller marshaller)
- Parameters:
marshaller - The marshaller to set.
setUnmarshaller
public void setUnmarshaller(Unmarshaller unmarshaller)
- Parameters:
unmarshaller - The unmarshaller to set.
deserialize
public Object deserialize(byte[] bytes)
throws SerializationException
- Description copied from interface:
RedisSerializer
- Deserialize an object from the given binary data.
- Specified by:
deserialize in interface RedisSerializer<Object>
- Parameters:
bytes - object binary representation
- Returns:
- the equivalent object instance
- Throws:
SerializationException
serialize
public byte[] serialize(Object t)
throws SerializationException
- Description copied from interface:
RedisSerializer
- Serialize the given object to binary data.
- Specified by:
serialize in interface RedisSerializer<Object>
- Parameters:
t - object to serialize
- Returns:
- the equivalent binary data
- Throws:
SerializationException