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.IDelegatingScopeProvider
This 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 class
QlScopeProvider.AllowedDbViewType
in different part of query allowed use different table.
-
Field Summary
Fields Modifier and Type Field Description static String
TYPES_USER_DATA_INTNL
static String
TYPES_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.IScope
createDescriptions(Iterable<QlScopeProvider.AllowedDbViewType> allowedType, org.eclipse.emf.ecore.EObject context)
Gets allowedDbViewElement
byQlScopeProvider.AllowedDbViewType
protected List<org.eclipse.xtext.resource.IEObjectDescription>
createFakeEObjectDescription(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
Create fakeIEObjectDescription
This action need for all refers in model will be resolve.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
static Map<String,String>
createUserDataForTypes(DbViewFieldDef child)
Creates special data for indexingDbViewFieldDef
elements.protected QlScopeProvider.AllowedDbViewType[]
defineAllowedDbView(boolean isTable, org.eclipse.emf.ecore.EObject context)
Define allowedDbViewElement
forcontext
protected 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 allowedDbViewElement
forcontext
protected org.eclipse.xtext.scoping.IScope
getAllowedDbView(QlScopeProvider.AllowedDbViewType type, org.eclipse.emf.ecore.EObject context)
Gets allowedDbViewElement
byQlScopeProvider.AllowedDbViewType
protected org.eclipse.xtext.scoping.IScope
getAllowedDbViewSource(org.eclipse.emf.ecore.EObject context)
Gets allowed from source sectionorg.eclipse.xtext.scoping.IScopeProvider
getDelegate()
protected org.eclipse.xtext.scoping.IScope
getDescriptionTempTable(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.IScope
getScope(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 boolean
isVirtualTableParameter(org.eclipse.emf.ecore.EObject context)
Checks thatcontext
corresponding 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 indexingDbViewFieldDef
elements. This special data contains information about returning types. Data about of returning types available by keyTYPES_USER_DATA_INTNL
orTYPES_USER_DATA_RU
- Parameters:
child
- indexingDbViewFieldDef
, can't benull
- Returns:
- special data for indexing
DbViewFieldDef
elements, nevernull
-
getScope
public org.eclipse.xtext.scoping.IScope getScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
- Specified by:
getScope
in interfaceorg.eclipse.xtext.scoping.IScopeProvider
-
getDelegate
public org.eclipse.xtext.scoping.IScopeProvider getDelegate()
- Specified by:
getDelegate
in 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 benull
descrs
- , 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 fakeIEObjectDescription
This 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 allowedDbViewElement
forcontext
- Parameters:
isTable
-context
-- Returns:
- types of allowed
DbViewElement
asQlScopeProvider.AllowedDbViewType
-
defineAllowedDbViewForRightContext
protected QlScopeProvider.AllowedDbViewType[] defineAllowedDbViewForRightContext(boolean isTable, org.eclipse.emf.ecore.EObject context)
Define allowedDbViewElement
forcontext
- Parameters:
isTable
-context
-- Returns:
- types of allowed
DbViewElement
asQlScopeProvider.AllowedDbViewType
-
defineAllowedDbViewForExpressionInQSExpression
protected QlScopeProvider.AllowedDbViewType[] defineAllowedDbViewForExpressionInQSExpression(org.eclipse.emf.ecore.EObject context)
- Parameters:
context
-- Returns:
- types of allowed
DbViewElement
asQlScopeProvider.AllowedDbViewType
-
defineAllowedDbViewForExpressionInSelectQuery
protected QlScopeProvider.AllowedDbViewType[] defineAllowedDbViewForExpressionInSelectQuery(org.eclipse.emf.ecore.EObject context, QuerySchemaExpression expr)
Define allowedDbViewElement
forcontext
, which isQuerySchemaExpression
. Thiscontext
part of select query, not operator of select query- Parameters:
context
-- Returns:
- types of allowed
DbViewElement
asQlScopeProvider.AllowedDbViewType
-
defineAllowedDbViewForExpressionInSelectOperator
protected QlScopeProvider.AllowedDbViewType[] defineAllowedDbViewForExpressionInSelectOperator(org.eclipse.emf.ecore.EObject context, QuerySchemaExpression expr)
Define allowedDbViewElement
forcontext
, which isQuerySchemaExpression
. Thiscontext
part of operator of select query- Parameters:
context
-- Returns:
- types of allowed
DbViewElement
asQlScopeProvider.AllowedDbViewType
-
createDescriptions
protected org.eclipse.xtext.scoping.IScope createDescriptions(Iterable<QlScopeProvider.AllowedDbViewType> allowedType, org.eclipse.emf.ecore.EObject context)
Gets allowedDbViewElement
byQlScopeProvider.AllowedDbViewType
- Parameters:
allowedType
- type ofQlScopeProvider.AllowedDbViewType
for getting actualIScope
, can't benull
context
- actual context of ql query, can't benull
- Returns:
IScope
of allowedDbViewElement
, nevernull
-
getAllowedDbView
protected org.eclipse.xtext.scoping.IScope getAllowedDbView(QlScopeProvider.AllowedDbViewType type, org.eclipse.emf.ecore.EObject context)
Gets allowedDbViewElement
byQlScopeProvider.AllowedDbViewType
- Parameters:
type
- ofQlScopeProvider.AllowedDbViewType
for getting actualIScope
, can't benull
actual
- context of ql query, can't benull
- Returns:
IScope
of 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
-QuerySchemaOperator
with source section, can't be null- Returns:
- collection of the
IEObjectDescription
of 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:
IScope
of 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
IEObjectDescription
fields for parameter of source table, nevernull
-
isVirtualTableParameter
protected boolean isVirtualTableParameter(org.eclipse.emf.ecore.EObject context)
Checks thatcontext
corresponding to the source table parameter- Parameters:
context
- contextEObject
, cannot benull
- Returns:
true
ifcontext
corresponding to the source table parameter,false
otherwise
-
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:
IScope
of allowedDbViewElement
, nevernull
-
-