|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.data.ExprInfo
org.basex.query.expr.Expr
org.basex.query.expr.ParseExpr
public abstract class ParseExpr
Abstract parse expression. All non-value expressions are derived from this class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.basex.query.expr.Expr |
---|
Expr.Flag |
Field Summary | |
---|---|
InputInfo |
info
Input information. |
long |
size
Cardinality of result; unknown if set to -1. |
SeqType |
type
Static type. |
Constructor Summary | |
---|---|
protected |
ParseExpr(InputInfo ii)
Constructor. |
Method Summary | ||
---|---|---|
void |
checkAdmin(QueryContext ctx)
Checks if the current user has create permissions. |
|
void |
checkAllUp(Expr... expr)
Ensures that all specified expressions are either updating or vacuous. |
|
Bin |
checkBinary(Expr e,
QueryContext ctx)
Checks if the specified expression yields a binary item. |
|
boolean |
checkBln(Expr e,
QueryContext ctx)
Checks if the specified expression yields a boolean. |
|
Collation |
checkColl(Expr e,
QueryContext ctx)
Checks if the specified collation is supported. |
|
void |
checkCreate(QueryContext ctx)
Checks if the current user has create permissions. |
|
Value |
checkCtx(QueryContext ctx)
Throws an exception if the context value is not set. |
|
double |
checkDbl(Expr e,
QueryContext ctx)
Checks if the specified expression yields a double. |
|
DBNode |
checkDBNode(Item it)
Checks if the specified expression is a database node. |
|
byte[] |
checkEStr(Expr e,
QueryContext ctx)
Checks if the specified expression yields a string or empty sequence. |
|
byte[] |
checkEStr(Item it)
Checks if the specified item is a string or an empty sequence. |
|
FItem |
checkFunc(Expr e,
QueryContext ctx)
Checks if the specified expression yields a string or binary item. |
|
Item |
checkItem(Expr e,
QueryContext ctx)
Checks if the specified expression yields a non-empty item. |
|
long |
checkItr(Expr e,
QueryContext ctx)
Checks if the specified expression is an integer. |
|
long |
checkItr(Item it)
Checks if the specified item is a number. |
|
Map |
checkMap(Item it)
Assures that the given (non- null ) item is a map. |
|
ANode |
checkNode(Expr e,
QueryContext ctx)
Checks if the specified expression yields a node. |
|
ANode |
checkNode(Item it)
Checks if the specified item is a node. |
|
ANode |
checkNode(QueryContext ctx)
Throws an exception if the context value is not a node. |
|
Item |
checkNoEmpty(Item it)
Checks if the specified item is no empty sequence. |
|
void |
checkNoneUp(Expr... expr)
Ensures that none of the specified expressions performs an update. |
|
void |
checkNoUp(Expr e)
Ensures that the specified expression performs no updates. |
|
QNm |
checkQNm(Expr e,
QueryContext ctx)
Checks if the specified expression has the specified type; if no, throws an exception. |
|
byte[] |
checkStr(Expr e,
QueryContext ctx)
Checks if the specified expression yields a string. |
|
byte[] |
checkStr(Item it)
Checks if the specified item is a string. |
|
byte[] |
checkStrBin(Item it)
Checks if the specified expression yields a string or binary item. |
|
Item |
checkType(Item it,
Type t)
Checks if the specified expression is an empty sequence; if yes, throws an exception. |
|
Data |
checkWrite(Data data,
QueryContext ctx)
Checks if the current user has write permissions for the specified database. |
|
static Expr |
compBln(Expr e,
InputInfo ii)
Returns a boolean equivalent for the specified expression. |
|
protected
|
copyType(T e)
Copies this expression's return type and size to the given expression. |
|
Item |
ebv(QueryContext ctx,
InputInfo ii)
Checks if the iterator can be dissolved into an effective boolean value. |
|
Item |
item(QueryContext ctx,
InputInfo ii)
Evaluates the expression and returns the resulting item or a null reference, if the expression yields an empty sequence. |
|
Iter |
iter(QueryContext ctx)
Evaluates the expression and returns an iterator on the resulting items. |
|
protected Expr |
optPre(Expr opt,
QueryContext ctx)
Adds an optimization info for pre-evaluating the specified expression. |
|
Expr |
preEval(QueryContext ctx)
Pre-evaluates the specified expression. |
|
long |
size()
Returns the sequence size or 1. |
|
Item |
test(QueryContext ctx,
InputInfo ii)
Performs a predicate test and returns the item if test was successful. |
|
SeqType |
type()
Returns the static type of the evaluated value. |
|
Value |
value(QueryContext ctx)
Evaluates the expression and returns the resulting value. |
Methods inherited from class org.basex.query.expr.Expr |
---|
accept, addText, checkUp, compEbv, compile, copy, copy, count, exprSize, has, hasFreeVars, indexAccessible, indexEquivalent, inline, inlineAll, isEmpty, isFunction, isItem, isVacuous, isValue, iterable, markTailCalls, optimize, removable, sameAs, uses, visitAll |
Methods inherited from class org.basex.data.ExprInfo |
---|
addPlan, addPlan, description, info, plan, planAttr, planElem, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public InputInfo info
public long size
public SeqType type
Constructor Detail |
---|
protected ParseExpr(InputInfo ii)
ii
- input infoMethod Detail |
---|
public Iter iter(QueryContext ctx) throws QueryException
Expr
Expr.item(org.basex.query.QueryContext, org.basex.util.InputInfo)
must be implemented
by an expression, as it may be called by this method.
iter
in class Expr
ctx
- query context
QueryException
- query exceptionpublic Item item(QueryContext ctx, InputInfo ii) throws QueryException
Expr
null
reference, if the expression yields an empty sequence.
If this method is not overwritten, Expr.iter(org.basex.query.QueryContext)
must be implemented
by an expression, as it may be called by this method.
item
in class Expr
ctx
- query contextii
- input info
QueryException
- query exceptionpublic Value value(QueryContext ctx) throws QueryException
Expr
value
in class Expr
ctx
- query context
QueryException
- query exceptionprotected final <T extends ParseExpr> T copyType(T e)
T
- expression typee
- expression
public final Item ebv(QueryContext ctx, InputInfo ii) throws QueryException
Expr
ebv
in class Expr
ctx
- query contextii
- input info
QueryException
- query exceptionpublic final Item test(QueryContext ctx, InputInfo ii) throws QueryException
Expr
test
in class Expr
ctx
- query contextii
- input info
QueryException
- query exceptionpublic SeqType type()
Expr
type
in class Expr
public final long size()
Expr
size
in class Expr
public final Expr preEval(QueryContext ctx) throws QueryException
ctx
- query context
QueryException
- query exceptionprotected final Expr optPre(Expr opt, QueryContext ctx)
opt
- optimized expressionctx
- query context
public static final Expr compBln(Expr e, InputInfo ii)
e
- expression to be rewrittenii
- input info
public void checkNoUp(Expr e) throws QueryException
e
- expression (may be null
)
QueryException
- query exceptionpublic final void checkNoneUp(Expr... expr) throws QueryException
expr
- expressions (may contain null
references)
QueryException
- query exceptionpublic void checkAllUp(Expr... expr) throws QueryException
expr
- expressions to be checked
QueryException
- query exceptionpublic final boolean checkBln(Expr e, QueryContext ctx) throws QueryException
e
- expression to be checkedctx
- query context
QueryException
- query exceptionpublic final double checkDbl(Expr e, QueryContext ctx) throws QueryException
e
- expression to be checkedctx
- query context
QueryException
- query exceptionpublic final long checkItr(Expr e, QueryContext ctx) throws QueryException
e
- expression to be checkedctx
- query context
QueryException
- query exceptionpublic final long checkItr(Item it) throws QueryException
it
- item to be checked
QueryException
- query exceptionpublic final ANode checkNode(Expr e, QueryContext ctx) throws QueryException
e
- expression to be checkedctx
- query context
QueryException
- query exceptionpublic final ANode checkNode(Item it) throws QueryException
it
- item to be checked
QueryException
- query exceptionpublic final DBNode checkDBNode(Item it) throws QueryException
it
- item to be checked
QueryException
- query exceptionpublic final Collation checkColl(Expr e, QueryContext ctx) throws QueryException
e
- expression to be checkedctx
- query context
null
(default collation)
QueryException
- query exceptionpublic final byte[] checkStr(Expr e, QueryContext ctx) throws QueryException
e
- expression to be evaluatedctx
- query context
QueryException
- query exceptionpublic final byte[] checkStr(Item it) throws QueryException
it
- item to be checked
QueryException
- query exceptionpublic final byte[] checkEStr(Item it) throws QueryException
it
- item to be checked
QueryException
- query exceptionpublic final Value checkCtx(QueryContext ctx) throws QueryException
ctx
- query context
QueryException
- query exceptionpublic final ANode checkNode(QueryContext ctx) throws QueryException
ctx
- query context
QueryException
- query exceptionpublic final Item checkItem(Expr e, QueryContext ctx) throws QueryException
e
- expression to be evaluatedctx
- query context
QueryException
- query exceptionpublic final Bin checkBinary(Expr e, QueryContext ctx) throws QueryException
e
- expression to be evaluatedctx
- query context
QueryException
- query exceptionpublic final byte[] checkStrBin(Item it) throws QueryException
it
- item to be checked
QueryException
- query exceptionpublic final QNm checkQNm(Expr e, QueryContext ctx) throws QueryException
e
- expression to be checkedctx
- query context
QueryException
- query exceptionpublic FItem checkFunc(Expr e, QueryContext ctx) throws QueryException
e
- expression to be evaluatedctx
- query context
QueryException
- query exceptionpublic final Item checkType(Item it, Type t) throws QueryException
it
- item to be checkedt
- type to be checked
QueryException
- query exceptionpublic final Item checkNoEmpty(Item it) throws QueryException
it
- item to be checked
QueryException
- query exceptionpublic final byte[] checkEStr(Expr e, QueryContext ctx) throws QueryException
e
- expression to be evaluatedctx
- query context
QueryException
- query exceptionpublic final void checkAdmin(QueryContext ctx) throws QueryException
ctx
- query context
QueryException
- query exceptionpublic final void checkCreate(QueryContext ctx) throws QueryException
ctx
- query context
QueryException
- query exceptionpublic final Data checkWrite(Data data, QueryContext ctx) throws QueryException
data
- data referencectx
- query context
QueryException
- query exceptionpublic Map checkMap(Item it) throws QueryException
null
) item is a map.
it
- item to check
QueryException
- if the item is not a map
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |