org.springframework.integration.xml.router
Class XPathRouter

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.handler.AbstractMessageHandler
          extended by org.springframework.integration.router.AbstractMessageRouter
              extended by org.springframework.integration.xml.router.XPathRouter
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, InitializingBean, Ordered, NamedComponent, Orderable, MessageHandler, TrackableComponent

public class XPathRouter
extends AbstractMessageRouter

Message Router that uses XPathExpression evaluation to determine channel names.


Field Summary
 
Fields inherited from class org.springframework.integration.router.AbstractMessageRouter
channelIdentifierMap
 
Fields inherited from class org.springframework.integration.handler.AbstractMessageHandler
logger
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
XPathRouter(java.lang.String expression)
          Create a router that uses an XPath expression with no namespaces.
XPathRouter(java.lang.String expression, java.util.Map<java.lang.String,java.lang.String> namespaces)
          Create a router that uses an XPath expression.
XPathRouter(java.lang.String expression, java.lang.String prefix, java.lang.String namespace)
          Create a router uses an XPath expression with one namespace.
XPathRouter(org.springframework.xml.xpath.XPathExpression expression)
          Create a router that uses the provided XPath expression.
 
Method Summary
protected  java.util.List<java.lang.Object> getChannelIdentifiers(Message<?> message)
          Subclasses must implement this method to return the channel identifiers.
 java.lang.String getComponentType()
          Subclasses may implement this method to provide component type information.
 void setConverter(XmlPayloadConverter converter)
          Specify the Converter to use when converting payloads prior to XPath evaluation.
 void setEvaluateAsString(boolean evaluateAsString)
           
 
Methods inherited from class org.springframework.integration.router.AbstractMessageRouter
getMessagingTemplate, getRequiredConversionService, handleMessageInternal, onInit, removeChannelMapping, setApplySequence, setChannelIdentifierMap, setChannelMapping, setChannelResolver, setDefaultOutputChannel, setIgnoreChannelNameResolutionFailures, setIgnoreSendFailures, setPrefix, setResolutionRequired, setSuffix, setTimeout
 
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler
getOrder, handleMessage, setOrder, setShouldTrack
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.integration.context.NamedComponent
getComponentName
 

Constructor Detail

XPathRouter

public XPathRouter(java.lang.String expression,
                   java.util.Map<java.lang.String,java.lang.String> namespaces)
Create 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

XPathRouter

public XPathRouter(java.lang.String expression,
                   java.lang.String prefix,
                   java.lang.String namespace)
Create 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

XPathRouter

public XPathRouter(java.lang.String expression)
Create a router that uses an XPath expression with no namespaces. For example '/one/@type'

Parameters:
expression - the XPath expression as a String

XPathRouter

public XPathRouter(org.springframework.xml.xpath.XPathExpression expression)
Create a router that uses the provided XPath expression.

Parameters:
expression - the XPath expression
Method Detail

setEvaluateAsString

public void setEvaluateAsString(boolean evaluateAsString)

setConverter

public void setConverter(XmlPayloadConverter converter)
Specify the Converter to use when converting payloads prior to XPath evaluation.


getComponentType

public java.lang.String getComponentType()
Description copied from class: IntegrationObjectSupport
Subclasses may implement this method to provide component type information.

Specified by:
getComponentType in interface NamedComponent
Overrides:
getComponentType in class AbstractMessageRouter

getChannelIdentifiers

protected java.util.List<java.lang.Object> getChannelIdentifiers(Message<?> message)
Description copied from class: AbstractMessageRouter
Subclasses must implement this method to return the channel identifiers.

Specified by:
getChannelIdentifiers in class AbstractMessageRouter