com.gridsystems.nextgrid.api.pom.expr
Class XPathExpression

java.lang.Object
  extended by nextgrid.api.pom.Expression
      extended by com.gridsystems.nextgrid.api.pom.expr.XPathExpression
All Implemented Interfaces:
java.io.Serializable

public final class XPathExpression
extends nextgrid.api.pom.Expression

XPath expression wrapper to simplify expression handling.

XPath is focused on retrieving and selecting nodes from an XML document. In this case we use its ability in the following way:

Author:
Rodrigo Ruiz
See Also:
Serialized Form

Constructor Summary
XPathExpression(java.lang.String text)
          Creates a new instance.
XPathExpression(java.lang.String text, int min, int max)
          Creates a new instance.
 
Method Summary
 boolean boolEval(nextgrid.api.env.ProcessEnvironment env, java.lang.Object o)
          
 org.apache.commons.jxpath.JXPathContext getRootContext(nextgrid.api.env.ProcessEnvironment env)
          Gets a shared context instance for the specified Process Environment.
 void validate()
          
 
Methods inherited from class nextgrid.api.pom.Expression
getLang, getText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathExpression

public XPathExpression(java.lang.String text)
                throws nextgrid.api.pom.ExpressionException
Creates a new instance.

Parameters:
text - The XPath expression
Throws:
nextgrid.api.pom.ExpressionException - If a compilation error occurs

XPathExpression

public XPathExpression(java.lang.String text,
                       int min,
                       int max)
                throws nextgrid.api.pom.ExpressionException
Creates a new instance.

Parameters:
text - The XPath expression
min - The minimum number of results
max - The maximum number of results
Throws:
nextgrid.api.pom.ExpressionException - If a compilation error occurs
Method Detail

validate

public void validate()
              throws nextgrid.api.pom.ExpressionException

Specified by:
validate in class nextgrid.api.pom.Expression
Throws:
nextgrid.api.pom.ExpressionException

boolEval

public boolean boolEval(nextgrid.api.env.ProcessEnvironment env,
                        java.lang.Object o)
                 throws nextgrid.api.pom.ExpressionException

Specified by:
boolEval in class nextgrid.api.pom.Expression
Throws:
nextgrid.api.pom.ExpressionException

getRootContext

public org.apache.commons.jxpath.JXPathContext getRootContext(nextgrid.api.env.ProcessEnvironment env)
Gets a shared context instance for the specified Process Environment.

This context will contain common variable definitions.

Parameters:
env - ProcessEnvironment for which to get a context
Returns:
The context


Copyright © 2006-2008 Grid Systems, S.A.. All Rights Reserved.