nextgrid.api.pom
Class Expression

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

public abstract class Expression
extends java.lang.Object
implements java.io.Serializable

Expression wrapper. Each subclass is responsible of implementing a specific language syntax.

Expressions are immutable objects. Their contents cannot be changed after construction, and a new instance must be created if a modification is required.

Author:
Rodrigo Ruiz
See Also:
Serialized Form

Constructor Summary
protected Expression(java.lang.String lang, java.lang.String text)
          Creates a new instance.
 
Method Summary
abstract  boolean boolEval(ProcessEnvironment env, java.lang.Object o)
          Evaluate this XPath expression as a boolean.
 java.lang.String getLang()
          Gets the language of this expression.
 java.lang.String getText()
          Gets the text value.
abstract  void validate()
          Checks that the expression is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Expression

protected Expression(java.lang.String lang,
                     java.lang.String text)
              throws ExpressionException
Creates a new instance.

Parameters:
lang - The expression language
text - The expression text
Throws:
ExpressionException - If an error occurs
Method Detail

getLang

public final java.lang.String getLang()
Gets the language of this expression.

Returns:
The language name for this expression

getText

public final java.lang.String getText()
Gets the text value.

Returns:
The text

validate

public abstract void validate()
                       throws ExpressionException
Checks that the expression is valid.

Throws:
ExpressionException - If the validation fails

boolEval

public abstract boolean boolEval(ProcessEnvironment env,
                                 java.lang.Object o)
                          throws ExpressionException
Evaluate this XPath expression as a boolean.

Parameters:
env - Environment for global configuration
o - The node set where the expression is to be evaluated
Returns:
The evaluation result
Throws:
ExpressionException - If an error occurs


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