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,ComparisonExpression,ComputedAttributeConstructorExpression,ComputedElementConstructorExpression,ConditionalExpression,ContextItemExpression,CreateCollectionExpression,DecimalLiteralExpression,DeleteExpression,DeleteIndexFromCollectionExpression,DeleteSearchFromCollectionExpression,DirElemConstructorExpression,DocumentNodeConstructorExpression,DoubleLiteralExpression,DynamicFunctionCallExpression,EditCollectionExpression,FilterExpression,FlworExpression,FunctionCallExpression,InlineFunctionExpression,InsertExpression,InsertIndexIntoCollectionExpression,InsertSearchIntoCollectionExpression,InstanceOfExpression,IntegerLiteralExpression,IsStaticallyExpression,MultiplicativeExpression,NamedFunctionReferenceExpression,NodeComparisonExpression,NotExpression,NullLiteralExpression,ObjectConstructorExpression,ObjectLookupExpression,OrExpression,PostfixLookupExpression,RangeExpression,RenameExpression,ReplaceExpression,SimpleMapExpression,SlashExpr,StatementsAndExpr,StatementsAndOptionalExpr,StepExpr,StringConcatExpression,StringLiteralExpression,SwitchExpression,TextNodeConstructorExpression,TextNodeExpression,TransformExpression,TreatExpression,TruncateCollectionExpression,TryCatchExpression,TypeSwitchExpression,UnaryExpression,UnaryLookupExpression,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 ExpressionClassificationprotected booleanprotected StaticContextprotected SequenceTypeFields inherited from class org.rumbledb.expressions.Node
highestExecutionMode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTells whether this expression is guaranteed to return zero or one item but not more.Gets the inferred expression classification of this node, for use ...Retrieves the static context attached to this expression.getStaticContextForRuntime(RumbleRuntimeConfiguration conf, VisitorConfig visitorConfig) Provides the inferred static type, only if static analysis is activated.booleanbooleanisUnset()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(StringBuffer buffer, int indent) Prints the node tree to a string buffer.voidsetExpressionClassification(ExpressionClassification expressionClassification) Sets the inferred expression classification of this node, for use ...voidsetSequential(boolean isSequential) Sets the sequential property of the expression.voidsetStaticContext(StaticContext staticContext) Sets the static context of the expression.voidsetStaticSequenceType(SequenceType staticSequenceType) Sets the inferred static type, for used by the static analysis visitor.Methods inherited from class org.rumbledb.expressions.Node
accept, getChildren, getDescendants, getDescendantsMatching, getHighestExecutionMode, getHighestExecutionMode, getMetadata, indentIt, isContextDependent, numberOfUnsetExecutionModes, serializeToJSONiq, setHighestExecutionMode, toString
-
Field Details
-
staticContext
-
staticSequenceType
-
expressionClassification
-
isSequential
protected boolean isSequential
-
-
Constructor Details
-
Expression
-
-
Method Details
-
getStaticContext
Retrieves the static context attached to this expression.- Returns:
- the static context.
-
setStaticContext
Sets the static context of the expression.- Parameters:
staticContext- the static context to set.
-
getStaticContextForRuntime
public RuntimeStaticContext getStaticContextForRuntime(RumbleRuntimeConfiguration conf, VisitorConfig visitorConfig) -
getStaticSequenceType
Provides the inferred static type, only if static analysis is activated.- Returns:
- the statically inferred sequence type.
-
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.
-
setStaticSequenceType
Sets the inferred static type, for used by the static analysis visitor.- Parameters:
staticSequenceType- the statically inferred sequence type to set.
-
getExpressionClassification
Gets the inferred expression classification of this node, for use ...- Returns:
- Expression Classification of the expression.
-
setExpressionClassification
Sets the inferred expression classification of this node, for use ...- Parameters:
expressionClassification- the statically inferred expression classification.
-
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.
-
isSequential
public boolean isSequential() -
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.
-