org.springframework.integration.xml.transformer
Class UnmarshallingTransformer
java.lang.Object
org.springframework.integration.transformer.AbstractTransformer
org.springframework.integration.transformer.AbstractPayloadTransformer<java.lang.Object,java.lang.Object>
org.springframework.integration.xml.transformer.UnmarshallingTransformer
- All Implemented Interfaces:
- Transformer
public class UnmarshallingTransformer
- extends AbstractPayloadTransformer<java.lang.Object,java.lang.Object>
An implementation of PayloadTransformer
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnmarshallingTransformer
public UnmarshallingTransformer(org.springframework.oxm.Unmarshaller unmarshaller)
setAlwaysUseSourceFactory
public void setAlwaysUseSourceFactory(boolean alwaysUseSourceFactory)
- If true always delegate to the
SourceFactory
.
- Parameters:
alwaysUseSourceFactory
-
setSourceFactory
public void setSourceFactory(SourceFactory sourceFactory)
- Parameters:
sourceFactory
-
transformPayload
public java.lang.Object transformPayload(java.lang.Object payload)
- Specified by:
transformPayload
in class AbstractPayloadTransformer<java.lang.Object,java.lang.Object>