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 class
DbViewVirtualFieldProcessor.State
Defines actual state ofDbViewVirtualFieldProcessor
-
Constructor Summary
Constructors Constructor Description DbViewVirtualFieldProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
defineState(DbViewSelectDef virtualTable)
Defines actual state byvirtualTable
DbViewVirtualFieldProcessor.State
getCurrentState()
Gets actualDbViewVirtualFieldProcessor.State
TypeDescriptionSource
getExpectedType(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 parametersQuerySchemaTableParameter
IExpressionTypeChecker.CheckResult
validate(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 benull
parameters
- 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 benull
parameters
- list ofQuerySchemaTableParameter
, can't benull
- Returns:
- results of validation (see
IExpressionTypeChecker.CheckResult
).
Return results can benull
if validator forvirtualTable
wasn't found
-
getCurrentState
public DbViewVirtualFieldProcessor.State getCurrentState()
Gets actualDbViewVirtualFieldProcessor.State
- Returns:
- current
DbViewVirtualFieldProcessor.State
ornull
if 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:IExpectedTypesComputer
Gets expected type for feature of expression- Specified by:
getExpectedType
in interfaceIExpectedTypesComputer
- Parameters:
expression
- expression, can't benull
feature
- feature of the expression, can benull
featureIndex
- index of feature- Returns:
- expected type for feature of expression, empty
TypeDescription
corresponding to anything type - See Also:
ITypeSystem
-
defineState
protected void defineState(DbViewSelectDef virtualTable)
Defines actual state byvirtualTable
- Parameters:
virtualTable
- current virtual table, can't benull
-
-