org.springframework.integration.xml.splitter
Class XPathMessageSplitter
java.lang.Object
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractReplyProducingMessageHandler
org.springframework.integration.splitter.AbstractMessageSplitter
org.springframework.integration.xml.splitter.XPathMessageSplitter
- All Implemented Interfaces:
- org.springframework.beans.factory.BeanFactoryAware, org.springframework.core.Ordered, MessageHandler
public class XPathMessageSplitter
- extends AbstractMessageSplitter
Message Splitter that uses an XPathExpression to split a
Document or String payload into a NodeList. The
return value will be either Strings or Nodes depending on the
received payload type. Additionally, node types will be converted to
Documents if the 'createDocuments' property is set to true.
- Author:
- Jonas Partner
| Fields inherited from interface org.springframework.core.Ordered |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XPathMessageSplitter
public XPathMessageSplitter(java.lang.String expression)
XPathMessageSplitter
public XPathMessageSplitter(java.lang.String expression,
java.util.Map<java.lang.String,java.lang.String> namespaces)
XPathMessageSplitter
public XPathMessageSplitter(org.springframework.xml.xpath.XPathExpression xpathExpression)
setCreateDocuments
public void setCreateDocuments(boolean createDocuments)
setDocumentBuilder
public void setDocumentBuilder(javax.xml.parsers.DocumentBuilderFactory documentBuilderFactory)
setXmlPayloadConverter
public void setXmlPayloadConverter(XmlPayloadConverter xmlPayloadConverter)
splitMessage
protected java.lang.Object splitMessage(Message<?> message)
- Description copied from class:
AbstractMessageSplitter
- Subclasses must override this method to split the received Message. The
return value may be a Collection or Array. The individual elements may
be Messages, but it is not necessary. If the elements are not Messages,
each will be provided as the payload of a Message. It is also acceptable
to return a single Object or Message. In that case, a single reply
Message will be produced.
- Specified by:
splitMessage in class AbstractMessageSplitter
splitNodePayload
protected java.util.List<org.w3c.dom.Node> splitNodePayload(org.w3c.dom.Node node,
Message message)
throws javax.xml.parsers.ParserConfigurationException
- Throws:
javax.xml.parsers.ParserConfigurationException
getNewDocumentBuilder
protected javax.xml.parsers.DocumentBuilder getNewDocumentBuilder()
throws javax.xml.parsers.ParserConfigurationException
- Throws:
javax.xml.parsers.ParserConfigurationException