Package org.dellroad.stuff.pobj
Class SpringDelegate<T>
java.lang.Object
org.dellroad.stuff.pobj.AbstractDelegate<T>
org.dellroad.stuff.pobj.SpringDelegate<T>
- Type Parameters:
T- type of the root persistent object
- All Implemented Interfaces:
PersistentObjectDelegate<T>,InitializingBean
PersistentObjectDelegate that uses Spring's Marshaller and Unmarshaller interfaces
for XML conversion.-
Field Summary
Fields inherited from class org.dellroad.stuff.pobj.AbstractDelegate
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserialize(Source source) Deserialize a root object graph from XML.voidSerialize a root object graph into XML.voidsetMarshaller(Marshaller marshaller) Set theMarshallerused to convert instances to XML.voidsetUnmarshaller(Unmarshaller unmarshaller) Set theMarshallerused to convert instances to XML.Methods inherited from class org.dellroad.stuff.pobj.AbstractDelegate
copy, getDefaultValue, handleWritebackException, isSameGraph, validate
-
Constructor Details
-
SpringDelegate
public SpringDelegate()
-
-
Method Details
-
setMarshaller
Set theMarshallerused to convert instances to XML. Required property.- Parameters:
marshaller- XML marshaller
-
setUnmarshaller
Set theMarshallerused to convert instances to XML. Required property.- Parameters:
unmarshaller- XML unmarshaller
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceInitializingBean- Throws:
Exception
-
serialize
Description copied from interface:PersistentObjectDelegateSerialize a root object graph into XML.Note that this method effectively defines what is contained in the object graph rooted at
obj.This method must not modify
objor any other object in its object graph.- Specified by:
serializein interfacePersistentObjectDelegate<T>- Parameters:
obj- object to serialize; must not be modifiedresult- XML destination- Throws:
IOException- if an I/O error occurs
-
deserialize
Description copied from interface:PersistentObjectDelegateDeserialize a root object graph from XML.This method also presents an opportunity to (re)construct any indexes used for optimizing queries into the root object graph.
- Specified by:
deserializein interfacePersistentObjectDelegate<T>- Parameters:
source- XML source- Returns:
- deserialized object
- Throws:
IOException- if an I/O error occurs
-