public abstract class ParseExpr extends Expr
| Modifier and Type | Field and Description |
|---|---|
InputInfo |
input
Input information.
|
long |
size
Cardinality of result; unknown if set to -1.
|
SeqType |
type
Static type.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ParseExpr(InputInfo ii)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkBln(Expr e,
QueryContext ctx)
Checks if the specified expression yields a boolean.
|
void |
checkColl(Expr e,
QueryContext ctx)
Checks if the specified collation is supported.
|
void |
checkCreate(QueryContext ctx)
Checks if the current user has admin permissions.
|
Value |
checkCtx(QueryContext ctx)
Throws an exception if the context item 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.
|
IO |
checkIO(Expr e,
QueryContext ctx)
Checks if an expression yields a valid and existing
IO instance. |
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(Item it)
Checks if the specified expression is a node.
|
Item |
checkNoEmpty(Item it)
Checks if the specified item is no empty sequence.
|
byte[] |
checkStr(Expr e,
QueryContext ctx)
Checks if the specified expression yields a string.
|
Item |
checkType(Item it,
Type t)
Checks if the specified expression is an empty sequence; if yes, throws
an exception.
|
Expr |
checkUp(Expr e,
QueryContext ctx)
Checks if the specified expressions is no updating expression.
|
void |
checkUp(QueryContext ctx,
Expr... expr)
Tests if the specified expressions are updating or vacuous.
|
void |
checkWrite(QueryContext ctx)
Checks if the current user has write permissions.
|
protected Expr |
compBln(Expr e)
Returns a boolean equivalent for the specified 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 sequence type of the evaluated value.
|
Value |
value(QueryContext ctx)
Evaluates the expression and returns the resulting value.
|
addText, comp, compEbv, count, hasFreeVars, indexAccessible, indexEquivalent, isEmpty, isFunction, isItem, isVacuous, isValue, iterable, markTailCalls, removable, remove, sameAs, usesdescription, info, plan, toStringpublic final InputInfo input
public long size
public SeqType type
protected ParseExpr(InputInfo ii)
ii - input infopublic Iter iter(QueryContext ctx) throws QueryException
ExprExpr.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 Exprctx - query contextQueryException - query exceptionpublic Item item(QueryContext ctx, InputInfo ii) throws QueryException
Exprnull 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 Exprctx - query contextii - input infoQueryException - query exceptionpublic Value value(QueryContext ctx) throws QueryException
Exprvalue in class Exprctx - query contextQueryException - query exceptionpublic final Item ebv(QueryContext ctx, InputInfo ii) throws QueryException
Exprebv in class Exprctx - query contextii - input infoQueryException - query exceptionpublic final Item test(QueryContext ctx, InputInfo ii) throws QueryException
Exprtest in class Exprctx - query contextii - input infoQueryException - query exceptionpublic SeqType type()
Exprpublic final long size()
Exprpublic final Expr preEval(QueryContext ctx) throws QueryException
ctx - query contextQueryException - query exceptionprotected final Expr optPre(Expr opt, QueryContext ctx)
opt - optimized expressionctx - query contextprotected final Expr compBln(Expr e)
e - expression to be rewrittenpublic final Expr checkUp(Expr e, QueryContext ctx) throws QueryException
e - expressionctx - query contextQueryException - query exceptionpublic void checkUp(QueryContext ctx, Expr... expr) throws QueryException
ctx - query contextexpr - expression arrayQueryException - query exceptionpublic final boolean checkBln(Expr e, QueryContext ctx) throws QueryException
e - expression to be checkedctx - query contextQueryException - query exceptionpublic final double checkDbl(Expr e, QueryContext ctx) throws QueryException
e - expression to be checkedctx - query contextQueryException - query exceptionpublic final long checkItr(Expr e, QueryContext ctx) throws QueryException
e - expression to be checkedctx - query contextQueryException - query exceptionpublic final long checkItr(Item it) throws QueryException
it - item to be checkedQueryException - query exceptionpublic final ANode checkNode(Item it) throws QueryException
it - item to be checkedQueryException - query exceptionpublic final DBNode checkDBNode(Item it) throws QueryException
it - item to be checkedQueryException - query exceptionpublic final void checkColl(Expr e, QueryContext ctx) throws QueryException
e - expression to be checkedctx - query contextQueryException - query exceptionpublic final byte[] checkStr(Expr e, QueryContext ctx) throws QueryException
e - expression to be evaluatedctx - query contextQueryException - query exceptionpublic final byte[] checkEStr(Item it) throws QueryException
it - item to be checkedQueryException - query exceptionpublic final Value checkCtx(QueryContext ctx) throws QueryException
ctx - query contextQueryException - query exceptionpublic final Item checkItem(Expr e, QueryContext ctx) throws QueryException
e - expression to be evaluatedctx - query contextQueryException - query exceptionpublic final Item checkType(Item it, Type t) throws QueryException
it - item to be checkedt - type to be checkedQueryException - query exceptionpublic final Item checkNoEmpty(Item it) throws QueryException
it - item to be checkedQueryException - query exceptionpublic final byte[] checkEStr(Expr e, QueryContext ctx) throws QueryException
e - expression to be evaluatedctx - query contextQueryException - query exceptionpublic final IO checkIO(Expr e, QueryContext ctx) throws QueryException
IO instance.
Returns the instance or an exception.e - expression to be evaluatedctx - query contextQueryException - query exceptionpublic final void checkCreate(QueryContext ctx) throws QueryException
ctx - query contextQueryException - query exceptionpublic final void checkWrite(QueryContext ctx) throws QueryException
ctx - query contextQueryException - query exceptionpublic Map checkMap(Item it) throws QueryException
null) item is a map.it - item to checkQueryException - if the item is not a map