Package org.basex.query.var
Class StaticVar
- java.lang.Object
-
- org.basex.query.expr.ExprInfo
-
- org.basex.query.scope.StaticScope
-
- org.basex.query.scope.StaticDecl
-
- org.basex.query.var.StaticVar
-
- All Implemented Interfaces:
Scope
public final class StaticVar extends StaticDecl
Static variable to which an expression can be assigned.- Author:
- BaseX Team 2005-23, BSD License, Leo Woerteler
-
-
Field Summary
Fields Modifier and Type Field Description boolean
external
Indicates if this variable can be bound from outside the query.-
Fields inherited from class org.basex.query.scope.StaticDecl
anns, dontEnter
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Expr
compile(CompileContext cc)
Compiles the expression contained in this scope.String
description()
Returns a string description of the expression.byte[]
id()
Returns a unique identifier for this declaration.void
toString(QueryString qs)
Creates a query string.void
toXml(QueryPlan plan)
Creates a query plan.Value
value(QueryContext qc)
Evaluates the expression and returns the resulting value.boolean
visit(ASTVisitor visitor)
Traverses this scope with the givenASTVisitor
.-
Methods inherited from class org.basex.query.scope.StaticDecl
reset, seqType
-
Methods inherited from class org.basex.query.scope.StaticScope
compiled, doc, doc
-
Methods inherited from class org.basex.query.expr.ExprInfo
info, toErrorString, toString
-
-
-
-
Method Detail
-
compile
public Expr compile(CompileContext cc) throws QueryException
Description copied from interface:Scope
Compiles the expression contained in this scope.- Parameters:
cc
- compilation context- Returns:
- compiled expression, or
null
if not required - Throws:
QueryException
- compilation errors
-
value
public Value value(QueryContext qc) throws QueryException
Description copied from class:StaticScope
Evaluates the expression and returns the resulting value.- Overrides:
value
in classStaticScope
- Parameters:
qc
- query context- Returns:
- result
- Throws:
QueryException
- query exception
-
visit
public boolean visit(ASTVisitor visitor)
Description copied from interface:Scope
Traverses this scope with the givenASTVisitor
.- Parameters:
visitor
- visitor- Returns:
- continue flag
-
id
public byte[] id()
Description copied from class:StaticDecl
Returns a unique identifier for this declaration.- Specified by:
id
in classStaticDecl
- Returns:
- a byte sequence that uniquely identifies this declaration
-
description
public String description()
Description copied from class:ExprInfo
Returns a string description of the expression. This method is only called by error messages. Contrary to theExprInfo.toString()
method, arguments are not included in the output.- Overrides:
description
in classExprInfo
- Returns:
- result of check
-
toXml
public void toXml(QueryPlan plan)
Description copied from class:ExprInfo
Creates a query plan.
-
toString
public void toString(QueryString qs)
Description copied from class:ExprInfo
Creates a query string.
-
-