Class XPathMessageSplitter
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractMessageProducingHandler
org.springframework.integration.handler.AbstractReplyProducingMessageHandler
org.springframework.integration.splitter.AbstractMessageSplitter
org.springframework.integration.xml.splitter.XPathMessageSplitter
- All Implemented Interfaces:
- org.reactivestreams.Subscriber<Message<?>>,- Aware,- BeanClassLoaderAware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- Ordered,- ExpressionCapable,- Orderable,- MessageProducer,- DiscardingMessageHandler,- HeaderPropagationAware,- IntegrationPattern,- NamedComponent,- IntegrationManagement,- TrackableComponent,- MessageHandler,- reactor.core.CoreSubscriber<Message<?>>
Message Splitter that uses an 
XPathExpression to split a
 Document, File 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, Mark Fisher, Artem Bilan, Gary Russell, Christian Tzolov
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandlerAbstractReplyProducingMessageHandler.RequestHandlerNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields inherited from class org.springframework.integration.handler.AbstractMessageProducingHandlermessagingTemplateFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagementMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionXPathMessageSplitter(String expression) XPathMessageSplitter(String expression, Map<String, String> namespaces) XPathMessageSplitter(String expression, Map<String, String> namespaces, TransformerFactory transformerFactory) Construct an instance based on the provided xpath expression, namespaces andTransformerFactory.XPathMessageSplitter(String expression, TransformerFactory transformerFactory) Construct an instance based on the provided xpath expression andTransformerFactory.XPathMessageSplitter(XPathExpression xpathExpression) XPathMessageSplitter(XPathExpression xpathExpression, TransformerFactory transformerFactory) Construct an instance based on the provided xpath expression andTransformerFactory.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voiddoInit()Subclasses may implement this method to provide component type information.protected intobtainSizeIfPossible(Iterator<?> iterator) Obtain a size of the providedIterator.voidsetCreateDocuments(boolean createDocuments) voidsetDocumentBuilder(DocumentBuilderFactory documentBuilderFactory) voidsetIterator(boolean iterator) voidsetOutputProperties(Properties outputProperties) A set of output properties that will be used to override any of the same properties in affect for the transformation.voidsetXmlPayloadConverter(XmlPayloadConverter xmlPayloadConverter) protected ObjectsplitMessage(Message<?> message) Subclasses must override this method to split the received Message.Methods inherited from class org.springframework.integration.splitter.AbstractMessageSplitteraddHeaders, getDiscardChannel, getIntegrationPatternType, handleRequestMessage, obtainSizeIfPossible, produceOutput, setApplySequence, setDiscardChannel, setDiscardChannelName, shouldCopyRequestHeaders, willAddHeadersMethods inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandlerdoInvokeAdvisedRequestHandler, getBeanClassLoader, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyMethods inherited from class org.springframework.integration.handler.AbstractMessageProducingHandleraddNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, setupMessageProcessor, shouldSplitOutput, updateNotPropagatedHeadersMethods inherited from class org.springframework.integration.handler.AbstractMessageHandlerhandleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionMethods inherited from class org.springframework.integration.handler.MessageHandlerSupportbuildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface reactor.core.CoreSubscribercurrentContextMethods inherited from interface org.springframework.integration.support.management.IntegrationManagementgetThisAsMethods inherited from interface org.springframework.messaging.MessageHandlerhandleMessageMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetBeanName, getComponentName
- 
Constructor Details- 
XPathMessageSplitter
- 
XPathMessageSplitterConstruct an instance based on the provided xpath expression andTransformerFactory.- Parameters:
- expression- the xpath expression for splitting.
- transformerFactory- the- TransformerFactoryfor parsing and building documents.
- Since:
- 4.3.19
 
- 
XPathMessageSplitter
- 
XPathMessageSplitterpublic XPathMessageSplitter(String expression, Map<String, String> namespaces, TransformerFactory transformerFactory) Construct an instance based on the provided xpath expression, namespaces andTransformerFactory.- Parameters:
- expression- the xpath expression for splitting.
- namespaces- the XML namespace for parsing.
- transformerFactory- the- TransformerFactoryfor parsing and building documents.
- Since:
- 4.3.19
 
- 
XPathMessageSplitter
- 
XPathMessageSplitterConstruct an instance based on the provided xpath expression andTransformerFactory.- Parameters:
- xpathExpression- the xpath expression for splitting.
- transformerFactory- the- TransformerFactoryfor parsing and building documents.
- Since:
- 4.3.19
 
 
- 
- 
Method Details- 
setCreateDocumentspublic void setCreateDocuments(boolean createDocuments) 
- 
getComponentTypeDescription copied from class:IntegrationObjectSupportSubclasses may implement this method to provide component type information.- Specified by:
- getComponentTypein interface- NamedComponent
- Overrides:
- getComponentTypein class- AbstractMessageSplitter
 
- 
setDocumentBuilder
- 
setXmlPayloadConverter
- 
setIteratorpublic void setIterator(boolean iterator) Theiteratormode:true(default) to return anIteratorfor splittingpayload,falseto return aList.- Parameters:
- iterator-- booleanflag for iterator mode. Default to- true.
- Since:
- 4.2
 
- 
setOutputPropertiesA set of output properties that will be used to override any of the same properties in affect for the transformation.- Parameters:
- outputProperties- the- Transformeroutput properties.
- Since:
- 4.2
- See Also:
 
- 
doInitprotected void doInit()- Overrides:
- doInitin class- AbstractMessageSplitter
 
- 
splitMessageDescription copied from class:AbstractMessageSplitterSubclasses 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:
- splitMessagein class- AbstractMessageSplitter
- Parameters:
- message- The message.
- Returns:
- The result of splitting the message.
 
- 
obtainSizeIfPossibleDescription copied from class:AbstractMessageSplitterObtain a size of the providedIterator. Default implementation returns0.- Overrides:
- obtainSizeIfPossiblein class- AbstractMessageSplitter
- Parameters:
- iterator- the- Iteratorto obtain the size
- Returns:
- the size of the Iterator
 
 
-