Class PayloadProcessor


  • public class PayloadProcessor
    extends Object
    Processor class for an abstract payload type.

    This class can be used to ease Smooks integration with application containers (for example ESBs). It works out how to filter the supplied Object payload through Smooks, to produce the desired sink type.

    The "payload" object supplied to the process(Object, ExecutionContext) method can be one of type:

    The SourceSink payload type allows full control over the filter Source and Sink.

    Author:
    Daniel Bevenius
    • Constructor Detail

      • PayloadProcessor

        public PayloadProcessor​(Smooks smooks,
                                SinkType sinkType)
        Public constructor.
        Parameters:
        smooks - The Smooks instance to be used.
        sinkType - The required sink type.
    • Method Detail

      • setJavaResultBeanId

        public void setJavaResultBeanId​(String javaResultBeanId)
        Set the bean ID to be unpacked from a JavaSink.

        Only relevant for SinkType.JAVA. If not specified, the complete result Map will be returned as the result of the process(Object, ExecutionContext) method call.

        Parameters:
        javaResultBeanId - The bean ID to be unpacked.
      • process

        public final Object process​(Object payload,
                                    org.smooks.api.ExecutionContext executionContext)
                             throws org.smooks.api.SmooksException
        Process the supplied payload.

        See class level javadoc.

        Parameters:
        payload - The payload to be filtered. See class level javadoc for supported data types.
        Returns:
        The filter result. Will be "unpacked" as per the SinkType supplied in the constructor.
        Throws:
        org.smooks.api.SmooksException