public abstract class AbstractExpression extends Object implements Visitable
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractExpression.Type |
| Modifier and Type | Field and Description |
|---|---|
protected AbstractExpression[] |
subs |
protected AbstractExpression |
sup |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractExpression(AbstractExpression.Type type) |
| Modifier and Type | Method and Description |
|---|---|
void |
acceptSubs(ExpressionVisitor visitor) |
protected void |
appendSub(StringBuilder buf,
AbstractExpression sub)
append the sub-expression to the buffer, wrapping it in parentheses if its precedence is
lower than or equal to this expression's.
|
boolean |
deepEquals(AbstractExpression oex) |
boolean |
equivalent(AbstractExpression other) |
boolean |
geq(AbstractExpression other) |
VariableContext |
getBindingContext()
If this expression depends "directly" on a variable, return that variable's binding context: a for or let clause,
or a global variable definition.
|
AbstractExpression |
getHead() |
AbstractExpression |
getLastContextStep()
This method is called by the optimizer in order to determine an element or attribute QName (or wildcard) against which
some expression is being compared, in order to generate an appropriate text query.
|
abstract int |
getPrecedence() |
AbstractExpression |
getRoot() |
AbstractExpression[] |
getSubs() |
AbstractExpression |
getSuper() |
AbstractExpression |
getTail() |
AbstractExpression.Type |
getType()
Most types will correspond one-one
with a subclass of AbstractExpression, but this
enumerated value provides an integer equivalent that should be
useful for efficient switch operations, encoding and the like.
|
boolean |
isAbsolute() |
boolean |
isDocumentOrdered() |
boolean |
isRestrictive()
An expression is restrictive when any empty sub implies the expression is empty.
|
boolean |
matchDown(AbstractExpression fieldExpr,
AbstractExpression fromExpr)
Traverse downwards, comparing with fromExpr for equivalence until one bottoms out,
ignoring fromExpr (since it has already been checked).
|
protected boolean |
propEquals(AbstractExpression oex) |
boolean |
propGreaterEqual(AbstractExpression oex) |
AbstractExpression |
replaceRoot(AbstractExpression replacement)
If this has absolute subexpressions, replace them with the replacement expression
(see
Root.replaceRoot(AbstractExpression) |
protected void |
setSubs(AbstractExpression... subExprs) |
String |
toString() |
abstract void |
toString(StringBuilder buf)
Each subclass must implement the toString(StringBuilder) method by
appending itself as a syntatically valid XPath/XQuery expression in
the given buffer.
|
protected AbstractExpression sup
protected AbstractExpression[] subs
protected AbstractExpression(AbstractExpression.Type type)
public AbstractExpression.Type getType()
public void acceptSubs(ExpressionVisitor visitor)
public AbstractExpression getSuper()
public AbstractExpression[] getSubs()
protected void setSubs(AbstractExpression... subExprs)
public abstract void toString(StringBuilder buf)
buf - the buffer to append topublic AbstractExpression getRoot()
public boolean isAbsolute()
public boolean isDocumentOrdered()
public AbstractExpression replaceRoot(AbstractExpression replacement)
Root.replaceRoot(AbstractExpression)replacement - the expression to use in place of '/'protected void appendSub(StringBuilder buf, AbstractExpression sub)
buf - the buffer to append tosub - the sub-expressionpublic AbstractExpression getHead()
public AbstractExpression getTail()
PathExpression.getTail().public AbstractExpression getLastContextStep()
public VariableContext getBindingContext()
public abstract int getPrecedence()
public boolean equivalent(AbstractExpression other)
other - another expressionpublic boolean geq(AbstractExpression other)
other - another expressionpublic boolean matchDown(AbstractExpression fieldExpr, AbstractExpression fromExpr)
fromExpr - fieldExpr - protected boolean propEquals(AbstractExpression oex)
oex - another expressionpublic boolean propGreaterEqual(AbstractExpression oex)
oex - another expression of the same type as thisthis ge oexpublic boolean deepEquals(AbstractExpression oex)
public boolean isRestrictive()
Copyright © 2013. All Rights Reserved.