Class QlFileStructureBuilder

java.lang.Object
com._1c.g5.ides.core.handle.impl.xtext.XtextStructureHelper
com._1c.g5.v8.dt.internal.ql.core.QlFileStructureBuilder
Direct Known Subclasses:
QlDcsFileStructureBuilder

public class QlFileStructureBuilder extends XtextStructureHelper
Builds the structure of an QlFile.
  • Constructor Details

    • QlFileStructureBuilder

      protected QlFileStructureBuilder(Map<org.eclipse.handly.model.IElement,Object> newElements, org.eclipse.xtext.resource.IResourceServiceProvider resourceServiceProvider)
      Constructs a new Ql structure builder.
      Parameters:
      newElements - the map to populate with structure elements (not null)
      resourceServiceProvider - Xtext's IResourceServiceProvider for the language (not null)
  • Method Details

    • getRange

      protected org.eclipse.handly.util.TextRange getRange()
      get current value of TextRange
      Returns:
      TextRange
    • setRange

      protected void setRange(org.eclipse.handly.util.TextRange range)
    • buildQlModule

      protected void buildQlModule(QlFile qlFile, org.eclipse.handly.model.impl.support.SourceElementBody parentBody, QuerySchema query)
      Building handle model for all queries in QL file
      Parameters:
      qlFile - processing QlFile, can't be null
      parentBody - parent Body for creating element, can't be null
      query - processing QuerySchema, can't be null
    • buildQlModule

      protected void buildQlModule(QuerySchema query, org.eclipse.handly.model.impl.support.Element handle, org.eclipse.handly.model.impl.support.SourceElementBody body)
      Parameters:
      query - processing QuerySchema, can't be null
      handle - actual Element, can't be null
      body - actual SourceElementBody, can't be null
    • buildPartOfSelectQuery

      protected void buildPartOfSelectQuery(SelectQueryImpl select, org.eclipse.handly.model.impl.support.SourceElementBody body, QuerySchemaSelectQuery selectQuery)
      Building handle model for part of select query
      Parameters:
      select - filling SelectQueryImpl, can't be null
      body - actual SourceElementBody, can't be null
      selectQuery - processing QuerySchemaSelectQuery, can't be null
    • buildPartOfSelectQueryOperator

      protected void buildPartOfSelectQueryOperator(FieldQueryImpl selectOperator, org.eclipse.handly.model.impl.support.SourceElementBody body, QuerySchemaOperator operator)
      Building handle model for each operators in select query
      Parameters:
      selectOperator - filling FieldQueryImpl, can't be null
      body - actual SourceElementBody, can't be null
      operator - processing QuerySchemaOperator, can't be null
      See Also:
    • buildFieldsPart

      protected void buildFieldsPart(org.eclipse.handly.model.impl.support.Element select, org.eclipse.handly.model.impl.support.SourceElementBody parentBody, List<QuerySchemaExpression> exprs)
      Building handle model for list of QuerySchemaExpression For each QuerySchemaExpression assigned one node of handle model. All of this nodes have equal parent select
      Parameters:
      select - actual Element, can't be null
      parentBody - parent Body for creating element, can't be null
      exprs - processing expression, can't be null
    • buildIntoPart

      protected void buildIntoPart(org.eclipse.handly.model.impl.support.Element select, org.eclipse.handly.model.impl.support.SourceElementBody parentBody, AbstractQuerySchemaTable table)
      Building part of QuerySchemaOperator: 'INTO' part
      Parameters:
      select - actual Element, can't be null
      parentBody - parent Body for creating element, can't be null
      table - processing AbstractQuerySchemaTable, can't be null
    • buildFromPart

      protected void buildFromPart(org.eclipse.handly.model.impl.support.Element select, org.eclipse.handly.model.impl.support.SourceElementBody parentBody, org.eclipse.emf.common.util.EList<QuerySchemaSource> sources)
      Building part of QuerySchemaOperator: 'FROM' part
      Parameters:
      select - actual Element, can't be null
      parentBody - parent Body for creating element, can't be null
      source - list of sources in 'FROM', can't be null
    • buildHavingWherePart

      protected void buildHavingWherePart(org.eclipse.handly.model.impl.support.Element select, org.eclipse.handly.model.impl.support.SourceElementBody parentBody, QuerySchemaExpression expr, IFieldQuery.FieldQueryType type)
      Building part of QuerySchemaSelectQuery: part 'WHERE' and 'HAVING'
      Parameters:
      select - actual Element, can't be null
      parentBody - parent Body for creating element, can't be null
      expr - processing expression, can't be null
      type - actual FieldQueryImpl, can't be null
    • buildGroupIndexPart

      protected void buildGroupIndexPart(org.eclipse.handly.model.impl.support.Element select, org.eclipse.handly.model.impl.support.SourceElementBody parentBody, org.eclipse.emf.common.util.EList<QuerySchemaExpression> exprs, IFieldQuery.FieldQueryType type)
      Building part of QuerySchemaSelectQuery: part 'INDEX BY' and 'GROUP BY'
      Parameters:
      select - actual Element, can't be null
      parentBody - parent Body for creating element, can't be null
      exprs - processing expression, can't be null
      type - actual FieldQueryImpl, can't be null
    • buildGroupingSetsPart

      protected void buildGroupingSetsPart(org.eclipse.handly.model.impl.support.Element select, org.eclipse.handly.model.impl.support.SourceElementBody parentBody, List<QuerySchemaGroupingSets> groups)
      Building part of QuerySchemaSelectQuery: part 'GROUP BY GROUPING SETS'
      Parameters:
      select - actual Element, cannot be null
      parentBody - parent Body for creating element, cannot be null
      groups - processing QuerySchemaGroupingSetss, cannot be null
    • buildIndexSetsPart

      protected void buildIndexSetsPart(org.eclipse.handly.model.impl.support.Element select, org.eclipse.handly.model.impl.support.SourceElementBody parentBody, List<QuerySchemaIndexSets> indexes)
      Building part of QuerySchemaSelectQuery: part 'INDEX BY SETS'
      Parameters:
      select - actual Element, cannot be null
      parentBody - parent Body for creating element, cannot be null
      groups - processing QuerySchemaIndexSetss, cannot be null
    • buildForUpdatePart

      protected void buildForUpdatePart(org.eclipse.handly.model.impl.support.Element select, org.eclipse.handly.model.impl.support.SourceElementBody parentBody, boolean isUpdate, org.eclipse.emf.common.util.EList<QuerySchemaTableForUpdate> tables)
      Building part of QuerySchemaSelectQuery: part 'FOR UPDATE'
      Parameters:
      select - actual Element, can't be null
      parentBody - parent Body for creating element, can't be null
      isUpdate - true if processing table from section 'FOR UPDATE', false otherwise
      tables - processing tables, can't be null
    • getSimpleKeyword

      protected String getSimpleKeyword(org.eclipse.emf.ecore.EObject expression)
      Get section name for expression. Note that expression must be first expression in this part
      Parameters:
      expression - processing expression, can't be null
      Returns:
      section name of the expression, can't be null
    • buildLeafField

      protected void buildLeafField(org.eclipse.handly.model.impl.support.Element parent, org.eclipse.handly.model.impl.support.SourceElementBody parentBody, org.eclipse.emf.ecore.EObject exprs, String theName)
      Common mechanism for building handle model for leaf fields in QL language
      Parameters:
      parent - parent Element element, can't be null
      parentBody - parent Body for creating element, can't be null
      exprs - processing object
      theName - actual name of the creating handle element
    • buildSelectQuery

      protected void buildSelectQuery(org.eclipse.handly.model.impl.support.Element parent, org.eclipse.handly.model.impl.support.SourceElementBody parentBody, QuerySchemaSelectQuery selectQuery, String alias)
      Building node in handle model linked with word 'SELECT'
      Parameters:
      parent - parent Element element, can't be null
      parentBody - parent Body for creating element, can't be null
      selectQuery - processing QuerySchemaSelectQuery, can't be null
      alias - actual alias of nested query
    • buildTableSourceParameter

      protected void buildTableSourceParameter(FieldQueryImpl field, org.eclipse.handly.model.impl.support.SourceElementBody bodyField, QuerySchemaTableParameter parameters)
      Building handle model for QuerySchemaTableParameter
      Parameters:
      field - filling FieldQueryImpl, can't be null
      bodyField - parent Body for creating element, can't be null
      parameters - table with parameters, can't be null
    • getExpressionName

      protected String getExpressionName(QuerySchemaExpression expr)
      Get name of expr for handle model
      Parameters:
      expr - processing expression
      Returns:
      name of the expression, can be null
    • buildJoinPart

      protected void buildJoinPart(org.eclipse.handly.model.impl.support.Element source, org.eclipse.handly.model.impl.support.SourceElementBody parentBody, AbstractQuerySchemaQuerySourceJoin abstrJoin)
      Building handle model for 'JOIN' part of QL language
      Parameters:
      source - parent Element element, can't be null
      parentBody - parent Body for creating element, can't be null
      abstrJoin - processing AbstractQuerySchemaQuerySourceJoin, can't be null
      See Also:
    • getAliasComputer

      protected AliasComputer getAliasComputer()
      Getting object for computing alias
      Returns:
      object for computing alias
      See Also:
    • getSelectName

      protected String getSelectName(QuerySchemaOperator operator, QuerySchemaSelectQuery selectQuery)
      Gets main keyword content of the QuerySchemaOperator
      Parameters:
      operator - actual QuerySchemaOperator, cannot be null
      selectQuery - actual QuerySchemaSelectQuery corresponding to the operator, cannot be null
      Returns:
      main keyword content of the QuerySchemaOperator, never null
    • getCommentText

      protected String getCommentText(QuerySchemaOperator operator)
      Gets comment node content on the same line of the keyword "SELECT" after it
      Parameters:
      operator - actual QuerySchemaOperator for getting comment node, cannot be null
      Returns:
      comment node content on the same line of the keyword "SELECT" after it, never null if node was not found empty string will be returned