mondrian.olap
Interface Validator


public interface Validator

Provides context necessary to resolve identifiers to objects, function calls to specific functions.

An expression calls validate(mondrian.olap.Exp, boolean) on each of its children, which in turn calls Exp.accept(mondrian.olap.Validator).

Author:
jhyde
 

Method Summary
 boolean canConvert(Exp fromExp, int to, int[] conversionCount)
          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.
 FunTable getFunTable()
          Returns the table of function and operator definitions.
 Query getQuery()
          Returns the Query which is being validated.
 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.
 

Method Detail

getQuery

Query getQuery()
Returns the Query which is being validated.


validate

Exp validate(Exp exp,
             boolean scalar)
Validates an expression, and returns the expression it resolves to.

Parameters:
exp - Expression to validate
scalar - Whether the context requires that the expression is evaluated to a value, as opposed to a tuple

validate

void validate(ParameterExpr parameterExpr)
Validates a usage of a parameter.

It must resolve to the same object (although sub-objects may change).


validate

void validate(MemberProperty memberProperty)
Validates a child member property.

It must resolve to the same object (although sub-objects may change).


validate

void validate(QueryAxis axis)
Validates an axis. It must resolve to the same object (although sub-objects may change).


validate

void validate(Formula formula)
Validates a formula. It must resolve to the same object (although sub-objects may change).


requiresExpression

boolean requiresExpression()
Returns whether the current context requires an expression.


canConvert

boolean canConvert(Exp fromExp,
                   int to,
                   int[] conversionCount)
Returns whether we can convert an argument to a parameter type.

Parameters:
fromExp - argument type
to - parameter type
conversionCount - in/out count of number of conversions performed; is incremented if the conversion is non-trivial (for example, converting a member to a level).

getFunTable

FunTable getFunTable()
Returns the table of function and operator definitions.


createOrLookupParam

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.


SourceForge.net_Logo