public interface Validator
An expression calls validate(mondrian.olap.Exp, boolean)
on each of its children,
which in turn calls Exp.accept(mondrian.olap.Validator)
.
Modifier and Type | Method and Description |
---|---|
boolean |
alwaysResolveFunDef()
Whether to resolve function name and arguments to a function definition
each time a node is validated, not just the first time.
|
boolean |
canConvert(int ordinal,
Exp fromExp,
int to,
List<Resolver.Conversion> conversions)
Returns whether we can convert an argument to a parameter type.
|
Parameter |
createOrLookupParam(boolean definition,
String name,
Type type,
Exp defaultExp,
String description)
Creates or retrieves the parameter corresponding to a "Parameter" or
"ParamRef" function call.
|
FunDef |
getDef(Exp[] args,
String name,
Syntax syntax)
Resolves a function call to a particular function.
|
FunTable |
getFunTable()
Returns the table of function and operator definitions.
|
Query |
getQuery()
Returns the
Query which is being validated. |
SchemaReader |
getSchemaReader()
Returns the schema reader with which to resolve names of MDX objects
(dimensions, hierarchies, levels, members, named sets).
|
boolean |
requiresExpression()
Returns whether the current context requires an expression.
|
Exp |
validate(Exp exp,
boolean scalar)
Validates an expression, and returns the expression it resolves to.
|
void |
validate(Formula formula)
Validates a formula.
|
void |
validate(MemberProperty memberProperty)
Validates a child member property.
|
void |
validate(ParameterExpr parameterExpr)
Validates a usage of a parameter.
|
void |
validate(QueryAxis axis)
Validates an axis.
|
Exp validate(Exp exp, boolean scalar)
exp
- Expression to validatescalar
- Whether the context requires that the expression is
evaluated to a value, as opposed to a tuplevoid validate(ParameterExpr parameterExpr)
It must resolve to the same object (although sub-objects may change).
void validate(MemberProperty memberProperty)
It must resolve to the same object (although sub-objects may change).
void validate(QueryAxis axis)
void validate(Formula formula)
boolean requiresExpression()
boolean canConvert(int ordinal, Exp fromExp, int to, List<Resolver.Conversion> conversions)
ordinal
- argument ordinalfromExp
- argument typeto
- parameter typeconversions
- List of conversions performed;
method adds an element for each non-trivial conversion (for
example, converting a member to a level).FunTable getFunTable()
Parameter createOrLookupParam(boolean definition, String name, Type type, Exp defaultExp, String description)
FunDef getDef(Exp[] args, String name, Syntax syntax)
boolean alwaysResolveFunDef()
Default implementation returns false
.
SchemaReader getSchemaReader()
The schema reader is initially in the context of the query's cube, and during a traversal it may change if named sets are introduced using the 'expr AS alias' construct.
Copyright © 2020 Hitachi Vantara. All rights reserved.