Class QuerySyntaxValidator

java.lang.Object
com.e1c.g5.v8.dt.check.components.BasicCheck
com.e1c.langtool.v8.dt.bsl.validation.QuerySyntaxValidator
All Implemented Interfaces:
ITopObjectFilter, ICheck

public class QuerySyntaxValidator extends BasicCheck
The validator allows to check correct syntax in QuerySchema loading from StringLiteral in module. Implementation maps all diagnostics from QL to the same line of string literal in module. This validator allows to check partly-valid queries if literal contains LangToolDefaults.PACKAGE_QUERY or LangToolDefaults.UNION_QUERY with the rest valid part of QL.
  • Field Details

  • Constructor Details

    • QuerySyntaxValidator

      public QuerySyntaxValidator()
  • Method Details

    • getCheckId

      public String getCheckId()
      Description copied from interface: ICheck
      Gets the unique identifier of the check. The identifier should be unique. The system performs automated identifier conflict resolution in case of non-unique identifiers, with addition of conflict-resolving symbols to the identifier
      Returns:
      The identifier of the check. May not be null
    • configureCheck

      protected void configureCheck(BasicCheck.CheckConfigurer builder)
      Description copied from class: BasicCheck
      The check is performed in case of changes of the tracjed object model/language module changes. In order to define the rules of the check performing, the developer should define the set of EClass'es and their features those changes are being tracked/or be targets of the validation
      Specified by:
      configureCheck in class BasicCheck
    • check

      protected void check(Object object, BasicCheck.ResultAcceptor resultAcceptor, ICheckParameters parameters, org.eclipse.core.runtime.IProgressMonitor monitor)
      Description copied from class: BasicCheck
      The method that performs the check. Check results (issues) need to be placed into the result acceptor. Validation may be cancelled by a user. Complex implemantations should take this into the account and check IProgressMonitor.isCanceled() periodically during long-running operations.
      Overrides:
      check in class BasicCheck
      Parameters:
      object - The object to check, not null
      resultAcceptor - Result acceptor, not null
      parameters - The set of check execution parameters taken from check settings, not null
      monitor - Current check progress monitor, not null
    • isValidReplaceParams

      protected boolean isValidReplaceParams(StringLiteral literal)
    • addResourceDiagnostics

      protected void addResourceDiagnostics(BasicCheck.ResultAcceptor resultAcceptor, org.eclipse.emf.ecore.resource.Resource resource, int lineShift)
    • getQuerySchema

      protected QuerySchema getQuerySchema(StringLiteral literal, org.eclipse.core.runtime.IProgressMonitor monitor)
    • getErrorMessage

      protected String getErrorMessage(org.eclipse.emf.ecore.resource.Resource.Diagnostic error)
    • getLineShift

      protected int getLineShift(StringLiteral literal, QuerySchema query)