org.dellroad.stuff.jibx
Class IdMappingMarshaller

java.lang.Object
  extended by org.dellroad.stuff.jibx.IdMappingMarshaller
All Implemented Interfaces:
InitializingBean, Marshaller, Unmarshaller

public class IdMappingMarshaller
extends Object
implements Marshaller, Unmarshaller, InitializingBean

Wrapper for Spring's JibxMarshaller that performs marshalling and unmarshalling operations within an invocation of IdGenerator.run(). Simply set your normal JibxMarshaller to the jibxMarshaller property and use this class in its place.

This is required when marshalling with JiBX mappings that utilize IdMapper.

See Also:
IdMapper

Constructor Summary
IdMappingMarshaller()
           
 
Method Summary
 void afterPropertiesSet()
           
 void marshal(Object graph, Result result)
          Invokdes JibxMarshaller.marshal() on the configured JibxMarshaller within an invocation of IdGenerator.run().
 void setJibxMarshaller(JibxMarshaller jibxMarshaller)
          Configure the nested JibxMarshaller.
 boolean supports(Class<?> type)
           
 Object unmarshal(Source source)
          Invokdes JibxMarshaller.unmarshal() on the configured JibxMarshaller within an invocation of IdGenerator.run().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdMappingMarshaller

public IdMappingMarshaller()
Method Detail

setJibxMarshaller

public void setJibxMarshaller(JibxMarshaller jibxMarshaller)
Configure the nested JibxMarshaller. Required property.


afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

marshal

public void marshal(Object graph,
                    Result result)
             throws IOException
Invokdes JibxMarshaller.marshal() on the configured JibxMarshaller within an invocation of IdGenerator.run().

Specified by:
marshal in interface Marshaller
Throws:
IOException

unmarshal

public Object unmarshal(Source source)
                 throws IOException
Invokdes JibxMarshaller.unmarshal() on the configured JibxMarshaller within an invocation of IdGenerator.run().

Specified by:
unmarshal in interface Unmarshaller
Throws:
IOException

supports

public boolean supports(Class<?> type)
Specified by:
supports in interface Marshaller
Specified by:
supports in interface Unmarshaller