public abstract class Expr
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static int |
ADD |
protected static int |
AND |
protected static int |
ATTRIBUTE |
protected static int |
BASE_URI |
protected static int |
BOOLEAN |
protected static int |
BOOLEAN_EQ |
protected static int |
BOOLEAN_NEQ |
protected static int |
CEILING |
protected static int |
CONCAT |
protected static int |
CONST |
protected static int |
CONTAINS |
protected static int |
COUNT |
protected static int |
DIV |
protected static int |
ELEMENT |
protected static int |
EQ |
protected static int |
FALSE |
protected static int |
FLOOR |
protected static int |
FORMAT_NUMBER |
protected static int |
FUNCTION_AVAILABLE |
protected static int |
GE |
protected static int |
GENERATE_ID |
protected static int |
GT |
protected static int |
ID |
protected static int |
IF |
protected static int |
LANG |
protected static int |
LAST |
protected static int |
LAST_FUN |
protected static int |
LE |
protected static int |
LOCAL_PART |
protected static int |
LT |
protected static int |
MOD |
protected static int |
MUL |
protected static int |
NAMESPACE |
protected static int |
NEG |
protected static int |
NEQ |
protected static int |
NODE_SET |
protected static int |
NORMALIZE |
protected static int |
NOT |
protected static int |
NUMBER |
protected static int |
NUMBER_EQ |
protected static int |
NUMBER_GE |
protected static int |
NUMBER_GT |
protected static int |
NUMBER_LE |
protected static int |
NUMBER_LT |
protected static int |
NUMBER_NEQ |
protected static int |
OR |
static int |
POSITION |
protected static int |
QNAME |
protected static int |
QUO |
protected static int |
ROUND |
protected static int |
SELF |
protected static int |
SELF_NAME |
protected static int |
STARTS_WITH |
protected static int |
STRING |
protected static int |
STRING_EQ |
protected static int |
STRING_LENGTH |
protected static int |
STRING_NEQ |
protected static int |
SUB |
protected static int |
SUBSTRING |
protected static int |
SUBSTRING_AFTER |
protected static int |
SUBSTRING_BEFORE |
protected static int |
SUM |
protected static int |
SYSTEM_PROPERTY |
protected static int |
TRANSLATE |
protected static int |
TRUE |
Modifier | Constructor and Description |
---|---|
protected |
Expr() |
Modifier and Type | Method and Description |
---|---|
void |
addParam(Env newEnv,
java.lang.String name,
org.w3c.dom.Node node,
Env env)
Adds a param with the expression's value.
|
void |
addVar(Env newEnv,
java.lang.String name,
org.w3c.dom.Node node,
Env env)
Adds a variable with the expression's value.
|
boolean |
evalBoolean(org.w3c.dom.Node node)
Returns the boolean value of the node.
|
abstract boolean |
evalBoolean(org.w3c.dom.Node node,
ExprEnvironment env)
Returns the boolean value of the node.
|
NodeIterator |
evalNodeSet(org.w3c.dom.Node node)
Returns an iterator of matching nodes
|
NodeIterator |
evalNodeSet(org.w3c.dom.Node node,
ExprEnvironment env)
Returns an iterator of matching nodes
|
double |
evalNumber(org.w3c.dom.Node node)
Evaluates the expression as a double using the node as a context.
|
abstract double |
evalNumber(org.w3c.dom.Node node,
ExprEnvironment env)
Evaluates the expression as a number.
|
java.lang.Object |
evalObject(org.w3c.dom.Node node)
Returns the object value of the node.
|
abstract java.lang.Object |
evalObject(org.w3c.dom.Node node,
ExprEnvironment env)
Returns the object value of the node.
|
void |
evalString(CharBuffer cb,
org.w3c.dom.Node node)
Fills a char buffer with the evaluated string results.
|
void |
evalString(CharBuffer cb,
org.w3c.dom.Node node,
ExprEnvironment env)
Fills a char buffer with the evaluated string results.
|
java.lang.String |
evalString(org.w3c.dom.Node node)
Returns the expression evaluated as a string.
|
abstract java.lang.String |
evalString(org.w3c.dom.Node node,
ExprEnvironment env)
Returns the string value of the node.
|
Var |
evalVar(org.w3c.dom.Node node,
ExprEnvironment env)
Evaluates to a variable.
|
AbstractPattern |
getListContext() |
boolean |
isBoolean()
true if the expression prefers to return a boolean.
|
boolean |
isNodeSet()
true if the expression prefers to return a node set.
|
boolean |
isNumber()
true if the expression prefers to return a number.
|
boolean |
isString()
true if the expression prefers to return a string.
|
void |
setListContext(AbstractPattern listContext) |
void |
setVar(java.lang.String name,
org.w3c.dom.Node node,
Env env)
Sets a variable with the expression's value.
|
protected static double |
stringToNumber(java.lang.String string)
Convert a string to a double following XPath.
|
static boolean |
toBoolean(java.lang.Object value)
Convert a Java object to a boolean using the XPath rules.
|
static double |
toDouble(java.lang.Object value)
Convert a Java object to a double using the XPath rules.
|
static org.w3c.dom.Node |
toNode(java.lang.Object value)
Convert a Java object to a node using the XPath rules.
|
protected AbstractPattern |
toNodeList()
Convert from an expression to a pattern.
|
static java.lang.String |
toString(java.lang.Object value)
Convert a Java object to a string using the XPath rules.
|
protected static final int CONST
protected static final int NODE_SET
protected static final int ID
protected static final int OR
protected static final int AND
protected static final int EQ
protected static final int NEQ
protected static final int LT
protected static final int LE
protected static final int GT
protected static final int GE
protected static final int BOOLEAN_EQ
protected static final int BOOLEAN_NEQ
protected static final int NUMBER_EQ
protected static final int NUMBER_NEQ
protected static final int NUMBER_LT
protected static final int NUMBER_LE
protected static final int NUMBER_GT
protected static final int NUMBER_GE
protected static final int STRING_EQ
protected static final int STRING_NEQ
protected static final int NEG
protected static final int ADD
protected static final int SUB
protected static final int MUL
protected static final int DIV
protected static final int QUO
protected static final int MOD
protected static final int TRUE
protected static final int FALSE
protected static final int NOT
protected static final int BOOLEAN
protected static final int LANG
protected static final int NUMBER
protected static final int SUM
protected static final int FLOOR
protected static final int CEILING
protected static final int ROUND
public static final int POSITION
protected static final int COUNT
protected static final int LAST
protected static final int STRING
protected static final int CONCAT
protected static final int STARTS_WITH
protected static final int CONTAINS
protected static final int SUBSTRING
protected static final int SUBSTRING_BEFORE
protected static final int SUBSTRING_AFTER
protected static final int STRING_LENGTH
protected static final int NORMALIZE
protected static final int TRANSLATE
protected static final int FORMAT_NUMBER
protected static final int LOCAL_PART
protected static final int NAMESPACE
protected static final int QNAME
protected static final int GENERATE_ID
protected static final int FUNCTION_AVAILABLE
protected static final int SYSTEM_PROPERTY
protected static final int IF
protected static final int SELF
protected static final int SELF_NAME
protected static final int ATTRIBUTE
protected static final int ELEMENT
protected static final int BASE_URI
protected static final int LAST_FUN
public void setListContext(AbstractPattern listContext)
public AbstractPattern getListContext()
public boolean isNumber()
public double evalNumber(org.w3c.dom.Node node) throws XPathException
node
- the node to evaluate and use as a contextXPathException
public abstract double evalNumber(org.w3c.dom.Node node, ExprEnvironment env) throws XPathException
node
- the current node.env
- variable environment.XPathException
public boolean isBoolean()
public boolean evalBoolean(org.w3c.dom.Node node) throws XPathException
node
- the node to evaluate and use as a contextXPathException
public abstract boolean evalBoolean(org.w3c.dom.Node node, ExprEnvironment env) throws XPathException
node
- the node to evaluate and use as a contextenv
- variable environment.XPathException
public java.lang.String evalString(org.w3c.dom.Node node) throws XPathException
node
- the node to evaluate and use as a contextXPathException
public boolean isString()
public abstract java.lang.String evalString(org.w3c.dom.Node node, ExprEnvironment env) throws XPathException
node
- the node to evaluate and use as a contextenv
- variable environment.XPathException
public void evalString(CharBuffer cb, org.w3c.dom.Node node) throws XPathException
cb
- the buffer containing the results.node
- the node to evaluate and use as a contextXPathException
public void evalString(CharBuffer cb, org.w3c.dom.Node node, ExprEnvironment env) throws XPathException
cb
- the buffer containing the results.node
- the node to evaluate and use as a contextenv
- the variable environmentXPathException
public boolean isNodeSet()
public NodeIterator evalNodeSet(org.w3c.dom.Node node) throws XPathException
node
- the node to evaluate and use as a contextXPathException
public NodeIterator evalNodeSet(org.w3c.dom.Node node, ExprEnvironment env) throws XPathException
node
- the node to evaluate and use as a contextenv
- variable environment.XPathException
public java.lang.Object evalObject(org.w3c.dom.Node node) throws XPathException
node
- the node to evaluate and use as a contextXPathException
public abstract java.lang.Object evalObject(org.w3c.dom.Node node, ExprEnvironment env) throws XPathException
node
- the node to evaluate and use as a contextenv
- variable environment.XPathException
public Var evalVar(org.w3c.dom.Node node, ExprEnvironment env) throws XPathException
node
- the node to evaluate and use as a context.env
- the variable environment.XPathException
public void addVar(Env newEnv, java.lang.String name, org.w3c.dom.Node node, Env env) throws XPathException
XPathException
public void setVar(java.lang.String name, org.w3c.dom.Node node, Env env) throws XPathException
XPathException
public void addParam(Env newEnv, java.lang.String name, org.w3c.dom.Node node, Env env) throws XPathException
XPathException
public static boolean toBoolean(java.lang.Object value) throws XPathException
XPathException
public static double toDouble(java.lang.Object value) throws XPathException
XPathException
public static java.lang.String toString(java.lang.Object value) throws XPathException
XPathException
public static org.w3c.dom.Node toNode(java.lang.Object value) throws XPathException
XPathException
protected static double stringToNumber(java.lang.String string) throws XPathException
string
- string to be treated as a double.XPathException
protected AbstractPattern toNodeList()