Package com._1c.g5.v8.dt.ql.scoping
Class QlScopeProvider
- java.lang.Object
-
- org.eclipse.xtext.scoping.impl.AbstractScopeProvider
-
- com._1c.g5.v8.dt.ql.scoping.QlScopeProvider
-
- All Implemented Interfaces:
org.eclipse.xtext.scoping.impl.IDelegatingScopeProvider,org.eclipse.xtext.scoping.IScopeProvider
- Direct Known Subclasses:
QlDcsScopeProvider,RightQlScopeProvider
public class QlScopeProvider extends org.eclipse.xtext.scoping.impl.AbstractScopeProvider implements org.eclipse.xtext.scoping.impl.IDelegatingScopeProviderThis class contains custom scoping description. see : http://www.eclipse.org/Xtext/documentation/latest/xtext.html#scoping on how and when to use it
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQlScopeProvider.AllowedDbViewTypein different part of query allowed use different table.
-
Field Summary
Fields Modifier and Type Field Description static StringTYPES_USER_DATA_INTNLstatic StringTYPES_USER_DATA_RU
-
Constructor Summary
Constructors Constructor Description QlScopeProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.eclipse.xtext.scoping.IScopecreateDescriptions(Iterable<QlScopeProvider.AllowedDbViewType> allowedType, org.eclipse.emf.ecore.EObject context)Gets allowedDbViewElementbyQlScopeProvider.AllowedDbViewTypeprotected List<org.eclipse.xtext.resource.IEObjectDescription>createFakeEObjectDescription(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)Create fakeIEObjectDescriptionThis action need for all refers in model will be resolve.protected org.eclipse.xtext.scoping.IScopecreateScope(org.eclipse.xtext.scoping.IScope parent, Iterable<org.eclipse.xtext.resource.IEObjectDescription> descrs)Created scope for gotten list ofIEObjectDescriptionstatic Map<String,String>createUserDataForTypes(DbViewFieldDef child)Creates special data for indexingDbViewFieldDefelements.protected QlScopeProvider.AllowedDbViewType[]defineAllowedDbView(boolean isTable, org.eclipse.emf.ecore.EObject context)Define allowedDbViewElementforcontextprotected QlScopeProvider.AllowedDbViewType[]defineAllowedDbViewForExpressionInQSExpression(org.eclipse.emf.ecore.EObject context)protected QlScopeProvider.AllowedDbViewType[]defineAllowedDbViewForExpressionInSelectOperator(org.eclipse.emf.ecore.EObject context, QuerySchemaExpression expr)protected QlScopeProvider.AllowedDbViewType[]defineAllowedDbViewForExpressionInSelectQuery(org.eclipse.emf.ecore.EObject context, QuerySchemaExpression expr)protected QlScopeProvider.AllowedDbViewType[]defineAllowedDbViewForRightContext(boolean isTable, org.eclipse.emf.ecore.EObject context)Define allowedDbViewElementforcontextprotected org.eclipse.xtext.scoping.IScopegetAllowedDbView(QlScopeProvider.AllowedDbViewType type, org.eclipse.emf.ecore.EObject context)Gets allowedDbViewElementbyQlScopeProvider.AllowedDbViewTypeprotected org.eclipse.xtext.scoping.IScopegetAllowedDbViewSource(org.eclipse.emf.ecore.EObject context)Gets allowed from source sectionorg.eclipse.xtext.scoping.IScopeProvidergetDelegate()protected org.eclipse.xtext.scoping.IScopegetDescriptionTempTable(org.eclipse.emf.ecore.EObject context)Gets allowed dbView from description temp tableprotected Collection<org.eclipse.xtext.resource.IEObjectDescription>getInnerFieldsFromSourceSection(QuerySchemaOperator operator)Gets descriptions of all inner fields from source section of operatororg.eclipse.xtext.scoping.IScopegetScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)protected Collection<org.eclipse.xtext.resource.IEObjectDescription>getTableParameterFields(org.eclipse.emf.ecore.EObject context)Gets descriptions of all fields for parameter of source tableprotected booleanisVirtualTableParameter(org.eclipse.emf.ecore.EObject context)Checks thatcontextcorresponding to the source table parameter
-
-
-
Field Detail
-
TYPES_USER_DATA_INTNL
public static final String TYPES_USER_DATA_INTNL
- See Also:
- Constant Field Values
-
TYPES_USER_DATA_RU
public static final String TYPES_USER_DATA_RU
- See Also:
- Constant Field Values
-
-
Method Detail
-
createUserDataForTypes
public static Map<String,String> createUserDataForTypes(DbViewFieldDef child)
Creates special data for indexingDbViewFieldDefelements. This special data contains information about returning types. Data about of returning types available by keyTYPES_USER_DATA_INTNLorTYPES_USER_DATA_RU- Parameters:
child- indexingDbViewFieldDef, can't benull- Returns:
- special data for indexing
DbViewFieldDefelements, nevernull
-
getScope
public org.eclipse.xtext.scoping.IScope getScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)- Specified by:
getScopein interfaceorg.eclipse.xtext.scoping.IScopeProvider
-
getDelegate
public org.eclipse.xtext.scoping.IScopeProvider getDelegate()
- Specified by:
getDelegatein interfaceorg.eclipse.xtext.scoping.impl.IDelegatingScopeProvider
-
createScope
protected org.eclipse.xtext.scoping.IScope createScope(org.eclipse.xtext.scoping.IScope parent, Iterable<org.eclipse.xtext.resource.IEObjectDescription> descrs)Created scope for gotten list ofIEObjectDescription- Parameters:
parent- parent scope, can't benulldescrs- , list ofIEObjectDescription, can't benull- Returns:
- created
IScope, nevernull
-
createFakeEObjectDescription
protected List<org.eclipse.xtext.resource.IEObjectDescription> createFakeEObjectDescription(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
Create fakeIEObjectDescriptionThis action need for all refers in model will be resolve. In validation stage check all refers and show correct warning or error messages- Parameters:
context-reference-- Returns:
- list of
IEObjectDescription
-
defineAllowedDbView
protected QlScopeProvider.AllowedDbViewType[] defineAllowedDbView(boolean isTable, org.eclipse.emf.ecore.EObject context)
Define allowedDbViewElementforcontext- Parameters:
isTable-context-- Returns:
- types of allowed
DbViewElementasQlScopeProvider.AllowedDbViewType
-
defineAllowedDbViewForRightContext
protected QlScopeProvider.AllowedDbViewType[] defineAllowedDbViewForRightContext(boolean isTable, org.eclipse.emf.ecore.EObject context)
Define allowedDbViewElementforcontext- Parameters:
isTable-context-- Returns:
- types of allowed
DbViewElementasQlScopeProvider.AllowedDbViewType
-
defineAllowedDbViewForExpressionInQSExpression
protected QlScopeProvider.AllowedDbViewType[] defineAllowedDbViewForExpressionInQSExpression(org.eclipse.emf.ecore.EObject context)
- Parameters:
context-- Returns:
- types of allowed
DbViewElementasQlScopeProvider.AllowedDbViewType
-
defineAllowedDbViewForExpressionInSelectQuery
protected QlScopeProvider.AllowedDbViewType[] defineAllowedDbViewForExpressionInSelectQuery(org.eclipse.emf.ecore.EObject context, QuerySchemaExpression expr)
Define allowedDbViewElementforcontext, which isQuerySchemaExpression. Thiscontextpart of select query, not operator of select query- Parameters:
context-- Returns:
- types of allowed
DbViewElementasQlScopeProvider.AllowedDbViewType
-
defineAllowedDbViewForExpressionInSelectOperator
protected QlScopeProvider.AllowedDbViewType[] defineAllowedDbViewForExpressionInSelectOperator(org.eclipse.emf.ecore.EObject context, QuerySchemaExpression expr)
Define allowedDbViewElementforcontext, which isQuerySchemaExpression. Thiscontextpart of operator of select query- Parameters:
context-- Returns:
- types of allowed
DbViewElementasQlScopeProvider.AllowedDbViewType
-
createDescriptions
protected org.eclipse.xtext.scoping.IScope createDescriptions(Iterable<QlScopeProvider.AllowedDbViewType> allowedType, org.eclipse.emf.ecore.EObject context)
Gets allowedDbViewElementbyQlScopeProvider.AllowedDbViewType- Parameters:
allowedType- type ofQlScopeProvider.AllowedDbViewTypefor getting actualIScope, can't benullcontext- actual context of ql query, can't benull- Returns:
IScopeof allowedDbViewElement, nevernull
-
getAllowedDbView
protected org.eclipse.xtext.scoping.IScope getAllowedDbView(QlScopeProvider.AllowedDbViewType type, org.eclipse.emf.ecore.EObject context)
Gets allowedDbViewElementbyQlScopeProvider.AllowedDbViewType- Parameters:
type- ofQlScopeProvider.AllowedDbViewTypefor getting actualIScope, can't benullactual- context of ql query, can't benull- Returns:
IScopeof allowedDbViewElement, nevernull
-
getInnerFieldsFromSourceSection
protected Collection<org.eclipse.xtext.resource.IEObjectDescription> getInnerFieldsFromSourceSection(QuerySchemaOperator operator)
Gets descriptions of all inner fields from source section of operator- Parameters:
operator-QuerySchemaOperatorwith source section, can't be null- Returns:
- collection of the
IEObjectDescriptionof inner fields from source section
-
getAllowedDbViewSource
protected org.eclipse.xtext.scoping.IScope getAllowedDbViewSource(org.eclipse.emf.ecore.EObject context)
Gets allowed from source section- Parameters:
context- actual context, can't benull- Returns:
IScopeof allowedDbViewElement, nevernull
-
getTableParameterFields
protected Collection<org.eclipse.xtext.resource.IEObjectDescription> getTableParameterFields(org.eclipse.emf.ecore.EObject context)
Gets descriptions of all fields for parameter of source table- Parameters:
context- context object from parameter of source table, each parameter has own set of allowed fields, cannot benull- Returns:
- collection of the
IEObjectDescriptionfields for parameter of source table, nevernull
-
isVirtualTableParameter
protected boolean isVirtualTableParameter(org.eclipse.emf.ecore.EObject context)
Checks thatcontextcorresponding to the source table parameter- Parameters:
context- contextEObject, cannot benull- Returns:
trueifcontextcorresponding to the source table parameter,falseotherwise
-
getDescriptionTempTable
protected org.eclipse.xtext.scoping.IScope getDescriptionTempTable(org.eclipse.emf.ecore.EObject context)
Gets allowed dbView from description temp table- Parameters:
context- actual context, can't benull- Returns:
IScopeof allowedDbViewElement, nevernull
-
-