Spring Integration

org.springframework.integration.xml.transformer
Class UnmarshallingTransformer

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.transformer.AbstractTransformer
          extended by org.springframework.integration.transformer.AbstractPayloadTransformer<java.lang.Object,java.lang.Object>
              extended by org.springframework.integration.xml.transformer.UnmarshallingTransformer
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, NamedComponent, Transformer

public class UnmarshallingTransformer
extends AbstractPayloadTransformer<java.lang.Object,java.lang.Object>

An implementation of Transformer that delegates to an OXM Unmarshaller. Expects the payload to be of type Document, String, File, Source or to have an instance of SourceFactory that can convert to a Source. If alwaysUseSourceFactory is set to true, then the SourceFactory will be used to create the Source regardless of payload type.

The Unmarshaller may return a Message, but if the return value is not already a Message instance, a new Message will be created with that return value as its payload.

Author:
Jonas Partner

Field Summary
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
UnmarshallingTransformer(org.springframework.oxm.Unmarshaller unmarshaller)
           
 
Method Summary
 void setAlwaysUseSourceFactory(boolean alwaysUseSourceFactory)
          If true always delegate to the SourceFactory.
 void setSourceFactory(SourceFactory sourceFactory)
          Provide the SourceFactory to be used.
 java.lang.Object transformPayload(java.lang.Object payload)
           
 
Methods inherited from class org.springframework.integration.transformer.AbstractPayloadTransformer
doTransform
 
Methods inherited from class org.springframework.integration.transformer.AbstractTransformer
transform
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getComponentName, getComponentType, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnmarshallingTransformer

public UnmarshallingTransformer(org.springframework.oxm.Unmarshaller unmarshaller)
Method Detail

setSourceFactory

public void setSourceFactory(SourceFactory sourceFactory)
Provide the SourceFactory to be used. Must not be null.


setAlwaysUseSourceFactory

public void setAlwaysUseSourceFactory(boolean alwaysUseSourceFactory)
If true always delegate to the SourceFactory.


transformPayload

public java.lang.Object transformPayload(java.lang.Object payload)
Specified by:
transformPayload in class AbstractPayloadTransformer<java.lang.Object,java.lang.Object>

Spring Integration