- All Known Subinterfaces:
IMetapathExpression
public interface IExpression
The common interface of all Metapath expression nodes.
Metapath expression nodes represent the different types of expressions that can appear in a Metapath query, forming a composite structure that can be traversed and evaluated.
- Since:
- 1.0.0
- See Also:
-
IExpressionVisitor
-
Method Summary
Modifier and TypeMethodDescription<RESULT,CONTEXT>
RESULTaccept(dev.metaschema.core.metapath.cst.IExpressionVisitor<RESULT, CONTEXT> visitor, CONTEXT context) Provides a double dispatch callback for visitor handling.accept(DynamicContext dynamicContext, ISequence<?> focus) Provides a double dispatch callback for visitor handling.The minimum expected result type to be produced when evaluating the expression.List<? extends IExpression>Retrieve the child expressions associated with this expression.getPath()Get the text for the expression.The expected result type produced by evaluating the expression.default StringProduce a string representation of this expression including the expression's name.
-
Method Details
-
getPath
Get the text for the expression.- Returns:
- the expression text
-
getChildren
Retrieve the child expressions associated with this expression.- Returns:
- a list of expressions, which may be empty
-
getBaseResultType
The minimum expected result type to be produced when evaluating the expression. The result may be a sub-class or sub-interface of this value.- Returns:
- the base result type
-
getStaticResultType
The expected result type produced by evaluating the expression. The result must be the same or a sub-class or sub-interface of the value provided bygetBaseResultType().This method can be overloaded to provide static analysis of the expression to determine a more specific result type.
- Returns:
- the result type
-
toCSTString
Produce a string representation of this expression including the expression's name.This method can be overloaded to provide a more appropriate representation of the expression.
- Returns:
- a string representing the data elements of the expression
-
accept
@NonNull ISequence<? extends IItem> accept(@NonNull DynamicContext dynamicContext, @NonNull ISequence<?> focus) Provides a double dispatch callback for visitor handling.- Parameters:
dynamicContext- the dynamic evaluation contextfocus- the outer focus of the expression- Returns:
- the result of evaluation
-
accept
<RESULT,CONTEXT> RESULT accept(@NonNull dev.metaschema.core.metapath.cst.IExpressionVisitor<RESULT, CONTEXT> visitor, @NonNull CONTEXT context) Provides a double dispatch callback for visitor handling.- Type Parameters:
RESULT- the type of the evaluation resultCONTEXT- the type of the visitor context- Parameters:
visitor- the visitor calling this methodcontext- the visitor context- Returns:
- the result of evaluation
-