📄 validator.java
字号:
/*
// $Id: //open/mondrian/src/main/mondrian/olap/Validator.java#3 $
// This software is subject to the terms of the Common Public License
// Agreement, available at the following URL:
// http://www.opensource.org/licenses/cpl.html.
// (C) Copyright 2005-2005 Julian Hyde
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
*/
package mondrian.olap;
/**
* Provides context necessary to resolve identifiers to objects, function
* calls to specific functions.
*
* <p>An expression calls {@link #validate} on each of its children,
* which in turn calls {@link Exp#accept}.
*
* @author jhyde
* @version $Id: //open/mondrian/src/main/mondrian/olap/Validator.java#3 $
*/
public interface Validator {
/**
* Returns the {@link Query} which is being validated.
*/
Query getQuery();
/**
* Validates an expression, and returns the expression it resolves to.
*
* @param exp Expression to validate
* @param scalar Whether the context requires that the expression is
* evaluated to a value, as opposed to a tuple
*/
Exp validate(Exp exp, boolean scalar);
/**
* Validates a parameter, and returns the new parameter it resolves to.
*/
Parameter validate(Parameter parameter);
/**
* Validates a child member property.
*
* It must resolve to the same object (although sub-objects may change).
*/
void validate(MemberProperty memberProperty);
/**
* Validates an axis.
*
* It must resolve to the same object (although sub-objects may change).
*/
void validate(QueryAxis axis);
/**
* Validates a formula.
*
* It must resolve to the same object (although sub-objects may change).
*/
void validate(Formula formula);
/**
* Returns whether the current context requires an expression.
*/
boolean requiresExpression();
/**
* Returns whether we can convert an argument to a parameter type.
*
* @param fromExp argument type
* @param to parameter type
* @param 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).
*
* @see #convert
*/
boolean canConvert(Exp fromExp, int to, int[] conversionCount);
/**
* Adds a casting function, if necessary, to ensure that an expression is
* of a given type. Throws an error if conversion is not possible.
*/
Exp convert(Exp fromExp, int to);
/**
* Returns the table of function and operator definitions.
*/
FunTable getFunTable();
/**
* Creates or retrieves the parameter corresponding to a "Parameter" or
* "ParamRef" function call.
*/
Parameter createOrLookupParam(FunCall call);
}
// End Validator.java
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -