org.kuali.rice.kew.xml.xstream
Class XStreamSafeEvaluator

java.lang.Object
  extended by org.kuali.rice.kew.xml.xstream.XStreamSafeEvaluator

public class XStreamSafeEvaluator
extends Object

Evaluates simple XPath expressions to follow paths through a document generated by XStream which uses "reference" elements to handle circular and duplicate references. For example, an XML document generated from XStream might look like the following:


   hello
   
     
   
 

In the above case, the XPath expression /test/a would result in the "hello" text but the XPath expression /test/b/a would result in the empty string. However, if the evaluator below is mapped as an XPath function, than it could be used as follows on the second expression to produce the desired result of "hello": xstreamsafe('/test/b/a', root())

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
XStreamSafeEvaluator()
           
XStreamSafeEvaluator(XPath xpath)
           
 
Method Summary
 NodeList evaluate(String xPathExpression, Node rootSearchNode)
          Evaluates the given XPath expression against the given Node while following reference attributes on Nodes in a way which is compatible with the XStream library.
 XPath getXpath()
           
 void setXpath(XPath xpath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XStreamSafeEvaluator

public XStreamSafeEvaluator()

XStreamSafeEvaluator

public XStreamSafeEvaluator(XPath xpath)
Method Detail

evaluate

public NodeList evaluate(String xPathExpression,
                         Node rootSearchNode)
                  throws XPathExpressionException
Evaluates the given XPath expression against the given Node while following reference attributes on Nodes in a way which is compatible with the XStream library.

Throws:
XPathExpressionException - if there was a problem evaluation the XPath expression.

getXpath

public XPath getXpath()

setXpath

public void setXpath(XPath xpath)


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.