Package org.rumbledb.expressions
Class Expression
java.lang.Object
org.rumbledb.expressions.Node
org.rumbledb.expressions.Expression
- Direct Known Subclasses:
AdditiveExpression,AndExpression,AppendExpression,ArrayConstructorExpression,ArrayLookupExpression,ArrayUnboxingExpression,AttributeNodeContentExpression,AttributeNodeExpression,BlockExpression,BooleanLiteralExpression,CastableExpression,CastExpression,CommaExpression,CommentNodeConstructorExpression,ComparisonExpression,ComputedAttributeConstructorExpression,ComputedElementConstructorExpression,ComputedNamespaceConstructorExpression,ComputedPIConstructorExpression,ConditionalExpression,ContextItemExpression,CreateCollectionExpression,DecimalLiteralExpression,DeleteExpression,DeleteIndexFromCollectionExpression,DeleteSearchFromCollectionExpression,DirectCommentConstructorExpression,DirElemConstructorExpression,DirPIConstructorExpression,DocumentNodeConstructorExpression,DoubleLiteralExpression,DynamicFunctionCallExpression,EditCollectionExpression,FilterExpression,FlworExpression,FunctionCallExpression,InlineFunctionExpression,InsertExpression,InsertIndexIntoCollectionExpression,InsertSearchIntoCollectionExpression,InstanceOfExpression,IntegerLiteralExpression,IsStaticallyExpression,MapConstructorExpression,MultiplicativeExpression,NamedFunctionReferenceExpression,NodeComparisonExpression,NodeSetExpression,NotExpression,NullLiteralExpression,ObjectConstructorExpression,ObjectLookupExpression,OrExpression,PathRootExpression,PostfixLookupExpression,RangeExpression,RenameExpression,ReplaceExpression,SimpleMapExpression,SlashExpr,StatementsAndExpr,StatementsAndOptionalExpr,StepExpr,StringConcatExpression,StringConstructorExpression,StringLiteralExpression,SwitchExpression,TextNodeConstructorExpression,TextNodeExpression,TransformExpression,TreatExpression,TruncateCollectionExpression,TryCatchExpression,TypeSwitchExpression,UnaryExpression,UnaryLookupExpression,ValidateExpression,ValidateTypeExpression,VariableReferenceExpression
An expression is the first-class citizen in JSONiq syntax. Any expression
returns a sequence of items.
Expressions form a tree, but this tree may contain other nodes, such as clauses
and function declarations.
An expression is associated with a static context containing information such as
the in-scope variables.
An expression has a classification, largely denoting it as UPDATING or SIMPLE.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ExpressionClassificationExpression Classification of the expression.protected booleanprotected StaticContextStatic context attached to this expressionprotected SequenceTypeStatically inferred sequence type.Fields inherited from class org.rumbledb.expressions.Node
highestExecutionMode, isInSequentialBlock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTells whether this expression is guaranteed to return zero or one item but not more.getStaticContextForRuntime(RumbleConfiguration conf, VisitorConfig visitorConfig) booleanisUnset()Tells whether this node has an unset expression classification.booleanTells whether this node is an updating expression or not.booleanReturns true if this node is updating and non-sequential.voidprint(StringBuilder buffer, int indent) Prints the node tree to a string buffer.voidsetIsInSequentialBlock(boolean isInSequentialBlock) voidsetSequential(boolean isSequential) Sets the sequential property of the expression.Methods inherited from class org.rumbledb.expressions.Node
accept, getChildren, getDescendants, getDescendantsMatching, getHighestExecutionMode, indentIt, isContextDependent, numberOfUnsetExecutionModes, serializeToJSONiq, toString
-
Field Details
-
staticContext
Static context attached to this expression -
staticSequenceType
Statically inferred sequence type. -
expressionClassification
Expression Classification of the expression. -
isSequential
protected boolean isSequential
-
-
Constructor Details
-
Expression
-
-
Method Details
-
getStaticContextForRuntime
public RuntimeStaticContext getStaticContextForRuntime(RumbleConfiguration conf, VisitorConfig visitorConfig) -
alwaysReturnsAtMostOneItem
public boolean alwaysReturnsAtMostOneItem()Tells whether this expression is guaranteed to return zero or one item but not more.- Returns:
- true if yes, false otherwise.
-
isUpdating
public boolean isUpdating()Tells whether this node is an updating expression or not.- Returns:
- true if yes, false otherwise.
-
isUnset
public boolean isUnset()Tells whether this node has an unset expression classification.- Returns:
- true if yes, false otherwise.
-
setSequential
public void setSequential(boolean isSequential) Sets the sequential property of the expression. An expression can only be one of the following:- non-updating sequential,
- non-updating non-sequential,
- updating non-sequential.
- Parameters:
isSequential- a boolean value defining if the expression is sequential or not.- Throws:
InvalidExpressionClassification- if the expression is both updating and sequential.
-
setIsInSequentialBlock
public void setIsInSequentialBlock(boolean isInSequentialBlock) - Overrides:
setIsInSequentialBlockin classNode
-
isUpdatingNonSequential
public boolean isUpdatingNonSequential()Returns true if this node is updating and non-sequential.- Returns:
- true if updating and non-sequential, false otherwise.
-
print
Description copied from class:NodePrints the node tree to a string buffer.
-