Class QlFormatter

  • All Implemented Interfaces:
    org.eclipse.xtext.formatting.IFormatter, org.eclipse.xtext.formatting.IFormatterExtension
    Direct Known Subclasses:
    QlDcsFormatter, RightQlFormatter

    public class QlFormatter
    extends org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter
    This class contains custom formatting description. see : http://www.eclipse.org/Xtext/documentation.html#formatting on how and when to use it Also see org.eclipse.xtext.xtext.XtextFormattingTokenSerializer as an example
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter

        org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter.ConfigStore
    • Field Summary

      • Fields inherited from class org.eclipse.xtext.formatting.impl.BaseFormatter

        grammar
    • Constructor Summary

      Constructors 
      Constructor Description
      QlFormatter()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void commonFormatRule​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common rule of formatting (for punctuation)
      protected void configureFormatting​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Formating all part of query
      org.eclipse.xtext.parsetree.reconstr.ITokenStream createFormatterStream​(String indent, org.eclipse.xtext.parsetree.reconstr.ITokenStream out, boolean preserveWhitespaces)  
      org.eclipse.xtext.parsetree.reconstr.ITokenStream createFormatterStream​(org.eclipse.emf.ecore.EObject context, String indent, org.eclipse.xtext.parsetree.reconstr.ITokenStream out, boolean preserveWhitespaces)  
      protected org.eclipse.xtext.formatting.impl.FormattingConfig createFormattingConfig()  
      protected org.eclipse.xtext.formatting.IElementMatcherProvider.IElementMatcher<org.eclipse.xtext.formatting.impl.AbstractFormattingConfig.ElementPattern> createMatcher()  
      protected void formatAbstractQuerySchemaFields​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting select fields
      protected void formatAbstractQuerySchemaSource​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for source of query
      protected void formatACastingType​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for cast operator
      protected void formatBetweenExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for Between expression
      protected void formatCaseBody​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting for case operator
      protected void formatCaseOperationExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for case operator
      protected void formatCastOperationExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting for 'in' operator
      protected void formatComment​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for comment
      protected void formatCommonUnaryNegOperatorExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for unary operator
      protected void formatDateLiteralExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting for date literal
      protected void formatFunctionExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting for function expression
      protected void formatInExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for In expression
      protected void formatLikeExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for Like expression
      protected void formatLinkExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for Link expression
      protected void formatLogicalAND​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for logical operator AND
      protected void formatLogicalComparison​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for logical comparison operator
      protected void formatLogicalMultiplicant​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for operator
      protected void formatLogicalOrExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for logical operator OR
      protected void formatNestedTable​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for Nested table
      protected void formatOtherSelector​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting other operator selector
      protected void formatParameterExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting for parameter literal
      protected void formatPrimaryExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting for PrimaryExpression
      protected void formatQuerySchema​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting around anything query
      protected void formatQuerySchemaGroupingSets​(org.eclipse.xtext.formatting.impl.FormattingConfig c)  
      protected void formatQuerySchemaNestedQuery​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Common Rule formatting nested query
      protected void formatQuerySchemaOrderExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting for order expression
      protected void formatQuerySchemaQuerySourceJoin​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting for joins in source
      protected void formatQuerySchemaSelectQuery​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting select query
      protected void formatQuerySchemaSource​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting for source of query
      protected void formatQuerySchemaTable​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting table in source
      protected void formatQuerySchemaTotalControlPoint​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting for control total points
      protected void formatTopSelector​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting top operator selector
      protected void formatTypeLiteralExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting for type literal
      protected void formatValueLiteralExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
      Rule formatting for value literal
      • Methods inherited from class org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter

        getConfig, getGrammarAccess, getHiddenTokenHelper, getIndentInfo, getLineSeparatorInfo, getMatcherProvider, saveDebugGraphvizDiagram, setGrammarAccess
      • Methods inherited from class org.eclipse.xtext.formatting.impl.BaseFormatter

        getWSRule
    • Constructor Detail

      • QlFormatter

        public QlFormatter()
    • Method Detail

      • createFormatterStream

        public org.eclipse.xtext.parsetree.reconstr.ITokenStream createFormatterStream​(String indent,
                                                                                       org.eclipse.xtext.parsetree.reconstr.ITokenStream out,
                                                                                       boolean preserveWhitespaces)
        Specified by:
        createFormatterStream in interface org.eclipse.xtext.formatting.IFormatter
        Overrides:
        createFormatterStream in class org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter
      • createFormatterStream

        public org.eclipse.xtext.parsetree.reconstr.ITokenStream createFormatterStream​(org.eclipse.emf.ecore.EObject context,
                                                                                       String indent,
                                                                                       org.eclipse.xtext.parsetree.reconstr.ITokenStream out,
                                                                                       boolean preserveWhitespaces)
        Specified by:
        createFormatterStream in interface org.eclipse.xtext.formatting.IFormatterExtension
        Overrides:
        createFormatterStream in class org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter
      • createFormattingConfig

        protected org.eclipse.xtext.formatting.impl.FormattingConfig createFormattingConfig()
        Overrides:
        createFormattingConfig in class org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter
      • createMatcher

        protected org.eclipse.xtext.formatting.IElementMatcherProvider.IElementMatcher<org.eclipse.xtext.formatting.impl.AbstractFormattingConfig.ElementPattern> createMatcher()
        Overrides:
        createMatcher in class org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter
      • configureFormatting

        protected void configureFormatting​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Formating all part of query
        Specified by:
        configureFormatting in class org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter
        Parameters:
        c - configuration
      • commonFormatRule

        protected void commonFormatRule​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common rule of formatting (for punctuation)
        Parameters:
        c - configuration
      • formatQuerySchema

        protected void formatQuerySchema​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting around anything query
        Parameters:
        c - configuration
      • formatQuerySchemaSelectQuery

        protected void formatQuerySchemaSelectQuery​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting select query
        Parameters:
        c - configuration
      • formatTopSelector

        protected void formatTopSelector​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting top operator selector
        Parameters:
        c - configuration
      • formatOtherSelector

        protected void formatOtherSelector​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting other operator selector
        Parameters:
        c - configuration
      • formatAbstractQuerySchemaFields

        protected void formatAbstractQuerySchemaFields​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting select fields
        Parameters:
        c - configuration
      • formatAbstractQuerySchemaSource

        protected void formatAbstractQuerySchemaSource​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for source of query
        Parameters:
        c - configuration
      • formatQuerySchemaTable

        protected void formatQuerySchemaTable​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting table in source
        Parameters:
        c - configuration
      • formatQuerySchemaNestedQuery

        protected void formatQuerySchemaNestedQuery​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting nested query
        Parameters:
        c - configuration
      • formatQuerySchemaSource

        protected void formatQuerySchemaSource​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting for source of query
        Parameters:
        c - configuration
      • formatQuerySchemaQuerySourceJoin

        protected void formatQuerySchemaQuerySourceJoin​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting for joins in source
        Parameters:
        c - configuration
      • formatQuerySchemaOrderExpression

        protected void formatQuerySchemaOrderExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting for order expression
        Parameters:
        c - configuration
      • formatQuerySchemaTotalControlPoint

        protected void formatQuerySchemaTotalControlPoint​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting for control total points
        Parameters:
        c - configuration
      • formatDateLiteralExpression

        protected void formatDateLiteralExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting for date literal
        Parameters:
        c - configuration
      • formatFunctionExpression

        protected void formatFunctionExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting for function expression
        Parameters:
        c - configuration
      • formatTypeLiteralExpression

        protected void formatTypeLiteralExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting for type literal
        Parameters:
        c - configuration
      • formatParameterExpression

        protected void formatParameterExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting for parameter literal
        Parameters:
        c - configuration
      • formatValueLiteralExpression

        protected void formatValueLiteralExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting for value literal
        Parameters:
        c - configuration
      • formatCaseOperationExpression

        protected void formatCaseOperationExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for case operator
        Parameters:
        c - configuration
      • formatCaseBody

        protected void formatCaseBody​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting for case operator
        Parameters:
        c - configuration
      • formatCastOperationExpression

        protected void formatCastOperationExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Rule formatting for 'in' operator
        Parameters:
        c - configuration
      • formatACastingType

        protected void formatACastingType​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for cast operator
        Parameters:
        c - configuration
      • formatCommonUnaryNegOperatorExpression

        protected void formatCommonUnaryNegOperatorExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for unary operator
        Parameters:
        c - configuration
      • formatLogicalOrExpression

        protected void formatLogicalOrExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for logical operator OR
        Parameters:
        c - configuration
      • formatLogicalAND

        protected void formatLogicalAND​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for logical operator AND
        Parameters:
        c - configuration
      • formatLogicalMultiplicant

        protected void formatLogicalMultiplicant​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for operator
        Parameters:
        c - configuration
      • formatLogicalComparison

        protected void formatLogicalComparison​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for logical comparison operator
        Parameters:
        c - configuration
      • formatLinkExpression

        protected void formatLinkExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for Link expression
        Parameters:
        c - configuration
      • formatBetweenExpression

        protected void formatBetweenExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for Between expression
        Parameters:
        c - configuration
      • formatLikeExpression

        protected void formatLikeExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for Like expression
        Parameters:
        c - configuration
      • formatInExpression

        protected void formatInExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for In expression
        Parameters:
        c - configuration
      • formatNestedTable

        protected void formatNestedTable​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for Nested table
        Parameters:
        c - configuration
      • formatComment

        protected void formatComment​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for comment
        Parameters:
        c - configuration, cannot be null
      • formatPrimaryExpression

        protected void formatPrimaryExpression​(org.eclipse.xtext.formatting.impl.FormattingConfig c)
        Common Rule formatting for PrimaryExpression
        Parameters:
        c - configuration, cannot be null
      • formatQuerySchemaGroupingSets

        protected void formatQuerySchemaGroupingSets​(org.eclipse.xtext.formatting.impl.FormattingConfig c)