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 ClassesModifier and TypeClassDescriptionstatic enum
in different part of query allowed use different table. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
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 sectionprotected org.eclipse.xtext.scoping.IScope
getAllowedDbViewThisQuery
(org.eclipse.emf.ecore.EObject context, boolean withAlias) Gets allowedDbViewElement
by currentQuerySchemaSelectQuery
org.eclipse.xtext.scoping.IScopeProvider
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>
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 parameterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.xtext.scoping.impl.IDelegatingScopeProvider
setWrapper
-
Field Details
-
TYPES_USER_DATA_INTNL
- See Also:
-
TYPES_USER_DATA_RU
- See Also:
-
-
Constructor Details
-
QlScopeProvider
public QlScopeProvider()
-
-
Method Details
-
createUserDataForTypes
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
-
getAllowedDbViewThisQuery
protected org.eclipse.xtext.scoping.IScope getAllowedDbViewThisQuery(org.eclipse.emf.ecore.EObject context, boolean withAlias) Gets allowedDbViewElement
by currentQuerySchemaSelectQuery
- Parameters:
context
- actual context of ql query, can't benull
withAlias
-true
if returningIScope
should contains only fields with real alias,false
if returningIScope
should contains only fields without real alias- Returns:
IScope
of allowedDbViewElement
, nevernull
-