Package com._1c.g5.v8.dt.ql.resource
Class DbViewVirtualFieldProcessor
- java.lang.Object
-
- com._1c.g5.v8.dt.ql.resource.DbViewVirtualFieldProcessor
-
- All Implemented Interfaces:
IExpectedTypesComputer
public class DbViewVirtualFieldProcessor extends Object implements IExpectedTypesComputer
Special class for processing virtual table (seeSelectDbView) in Ql language
This class implements pattern "State"
The state defines by the processing virtual table (seeSelectDbView)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDbViewVirtualFieldProcessor.StateDefines actual state ofDbViewVirtualFieldProcessor
-
Constructor Summary
Constructors Constructor Description DbViewVirtualFieldProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddefineState(DbViewSelectDef virtualTable)Defines actual state byvirtualTableDbViewVirtualFieldProcessor.StategetCurrentState()Gets actualDbViewVirtualFieldProcessor.StateTypeDescriptionSourcegetExpectedType(org.eclipse.emf.ecore.EObject expression, org.eclipse.emf.ecore.EStructuralFeature feature, int featureIndex)Gets expected type for feature of expressionList<? extends DbViewElement>getVirtualFields(DbViewSelectDef virtualTable, List<QuerySchemaTableParameter> parameters)Computes fields for virtual table by list of parametersQuerySchemaTableParameterIExpressionTypeChecker.CheckResultvalidate(DbViewSelectDef virtualTable, List<QuerySchemaTableParameter> parameters)Validates parameters for current virtual table
-
-
-
Method Detail
-
getVirtualFields
public List<? extends DbViewElement> getVirtualFields(DbViewSelectDef virtualTable, List<QuerySchemaTableParameter> parameters)
Computes fields for virtual table by list of parametersQuerySchemaTableParameter- Parameters:
virtualTable- current virtual table, can't benullparameters- list ofQuerySchemaTableParameter- Returns:
- list of computed fields. You should always return empty list if errors was detected.
Return results can't benull
-
validate
public IExpressionTypeChecker.CheckResult validate(DbViewSelectDef virtualTable, List<QuerySchemaTableParameter> parameters)
Validates parameters for current virtual table- Parameters:
virtualTable- current virtual table, can't benullparameters- list ofQuerySchemaTableParameter, can't benull- Returns:
- results of validation (see
IExpressionTypeChecker.CheckResult).
Return results can benullif validator forvirtualTablewasn't found
-
getCurrentState
public DbViewVirtualFieldProcessor.State getCurrentState()
Gets actualDbViewVirtualFieldProcessor.State- Returns:
- current
DbViewVirtualFieldProcessor.Stateornullif state hasn't been initialized yet
-
getExpectedType
public TypeDescriptionSource getExpectedType(org.eclipse.emf.ecore.EObject expression, org.eclipse.emf.ecore.EStructuralFeature feature, int featureIndex)
Description copied from interface:IExpectedTypesComputerGets expected type for feature of expression- Specified by:
getExpectedTypein interfaceIExpectedTypesComputer- Parameters:
expression- expression, can't benullfeature- feature of the expression, can benullfeatureIndex- index of feature- Returns:
- expected type for feature of expression, empty
TypeDescriptioncorresponding to anything type - See Also:
ITypeSystem
-
defineState
protected void defineState(DbViewSelectDef virtualTable)
Defines actual state byvirtualTable- Parameters:
virtualTable- current virtual table, can't benull
-
-