Class XPathRouter
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.router.AbstractMessageRouter
org.springframework.integration.router.AbstractMappingMessageRouter
org.springframework.integration.xml.router.XPathRouter
- All Implemented Interfaces:
- org.reactivestreams.Subscriber<Message<?>>,- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- Ordered,- ComponentSourceAware,- ExpressionCapable,- Orderable,- IntegrationPattern,- MessageRouter,- NamedComponent,- IntegrationManagement,- MappingMessageRouterManagement,- TrackableComponent,- MessageHandler,- reactor.core.CoreSubscriber<Message<?>>
Message Router that uses 
XPathExpression evaluation to determine channel names.- Author:
- Jonas Partner, Oleg Zhurakousky
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields 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 SummaryConstructorsConstructorDescriptionXPathRouter(String expression) Create a router that uses an XPath expression with no namespaces.XPathRouter(String expression, String prefix, String namespace) Create a router uses an XPath expression with one namespace.XPathRouter(String expression, Map<String, String> namespaces) Create a router that uses an XPath expression.XPathRouter(XPathExpression expression) Create a router that uses the provided XPath expression.
- 
Method SummaryModifier and TypeMethodDescriptiongetChannelKeys(Message<?> message) Subclasses must implement this method to return the channel keys.Subclasses may implement this method to provide component type information.voidsetConverter(XmlPayloadConverter converter) Specify the Converter to use when converting payloads prior to XPath evaluation.voidsetEvaluateAsString(boolean evaluateAsString) Methods inherited from class org.springframework.integration.router.AbstractMappingMessageRouterdetermineTargetChannels, getChannelMappings, getDynamicChannelNames, onInit, removeChannelMapping, replaceChannelMappings, setChannelKeyFallback, setChannelMapping, setChannelMappings, setDefaultOutputChannel, setDefaultOutputChannelName, setDynamicChannelLimit, setPrefix, setResolutionRequired, setSuffixMethods inherited from class org.springframework.integration.router.AbstractMessageRoutergetDefaultOutputChannel, getIntegrationPatternType, getMessagingTemplate, getRequiredConversionService, handleMessageInternal, setApplySequence, setIgnoreSendFailures, setSendTimeoutMethods 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, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, 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.integration.support.context.NamedComponentgetBeanName, getComponentName
- 
Constructor Details- 
XPathRouterCreate a router that uses an XPath expression. The expression may contain zero or more namespace prefixes.- Parameters:
- expression- the XPath expression as a String
- namespaces- map of namespaces with prefixes as the map keys
 
- 
XPathRouterCreate a router uses an XPath expression with one namespace. For example, expression='/ns1:one/@type' prefix='ns1' namespace='www.example.org'- Parameters:
- expression- the XPath expression as a String
- prefix- namespace prefix
- namespace- namespace uri
 
- 
XPathRouterCreate a router that uses an XPath expression with no namespaces. For example '/one/@type'- Parameters:
- expression- the XPath expression as a String
 
- 
XPathRouterCreate a router that uses the provided XPath expression.- Parameters:
- expression- the XPath expression
 
 
- 
- 
Method Details- 
setEvaluateAsStringpublic void setEvaluateAsString(boolean evaluateAsString) 
- 
setConverterSpecify the Converter to use when converting payloads prior to XPath evaluation.- Parameters:
- converter- The payload converter.
 
- 
getComponentTypeDescription copied from class:IntegrationObjectSupportSubclasses may implement this method to provide component type information.- Specified by:
- getComponentTypein interface- NamedComponent
- Overrides:
- getComponentTypein class- AbstractMessageRouter
 
- 
getChannelKeysDescription copied from class:AbstractMappingMessageRouterSubclasses must implement this method to return the channel keys. A "key" might be present in this router's "channelMappings", or it could be the channel's name or even the Message Channel instance itself.- Specified by:
- getChannelKeysin class- AbstractMappingMessageRouter
- Parameters:
- message- The message.
- Returns:
- The channel keys.
 
 
-