org.ikasan.framework.component.routing
Class XPathSelectorRouter

java.lang.Object
  extended by org.ikasan.framework.component.routing.SingleResultRouter
      extended by org.ikasan.framework.component.routing.XPathSelectorRouter
All Implemented Interfaces:
Router, FlowComponent

public class XPathSelectorRouter
extends SingleResultRouter

XPath router evaluation based on evaluating an incoming XPath expression into the node value. The resulting node value is returned. The pre-configured documentBuilderFactory and XPath selector expression are passed to this class on construction.

Author:
Ikasan Development Team

Field Summary
 
Fields inherited from interface org.ikasan.framework.component.routing.Router
DEFAULT_RESULT
 
Constructor Summary
XPathSelectorRouter(DocumentBuilderFactory factory, String xpathExpression)
          Constructor with no default transition supported.
XPathSelectorRouter(DocumentBuilderFactory factory, String xpathExpression, boolean returnsDefaultForNonMatches)
          Constructor
 
Method Summary
 String evaluate(Event event)
          Returns a single value as a result of evaluating the Event
 
Methods inherited from class org.ikasan.framework.component.routing.SingleResultRouter
onEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathSelectorRouter

public XPathSelectorRouter(DocumentBuilderFactory factory,
                           String xpathExpression,
                           boolean returnsDefaultForNonMatches)
Constructor

Parameters:
factory - - configured DocumentBuilderFactory
xpathExpression - - configured XPath expression to evaluate
returnsDefaultForNonMatches - - use the 'default' transition if no other transitions are matched

XPathSelectorRouter

public XPathSelectorRouter(DocumentBuilderFactory factory,
                           String xpathExpression)
Constructor with no default transition supported.

Parameters:
factory - - configured DocumentBuilderFactory
xpathExpression - - configured XPath expression
Method Detail

evaluate

public String evaluate(Event event)
                throws RouterException
Description copied from class: SingleResultRouter
Returns a single value as a result of evaluating the Event

Specified by:
evaluate in class SingleResultRouter
Parameters:
event - to evaluate
Returns:
result
Throws:
RouterException - Exception if we could not route the event


Copyright © 2007-2012 Ikasan. All Rights Reserved.