Class DatabaseType

  • All Implemented Interfaces:
    Expression

    public final class DatabaseType
    extends AbstractDoubleEncapsulatedExpression
    This expression represents the database specific data type, which may include size and scale.
    BNF: database_type ::= data_type_literal [( [numeric_literal [, numeric_literal]] )]
    BNF: data_type_literal ::= [CHAR, VARCHAR, NUMERIC, INTEGER, DATE, TIME, TIMESTAMP, etc]

    Example: CASE(e.name AS VARCHAR(20))

    Since:
    2.4
    Version:
    2.5
    Author:
    Pascal Filion
    • Constructor Detail

      • DatabaseType

        public DatabaseType​(AbstractExpression parent,
                            String databaseType)
        Creates a new DatabaseType.
        Parameters:
        parent - The parent of this expression
        databaseType - The database type
    • Method Detail

      • shouldParseRightParenthesis

        protected boolean shouldParseRightParenthesis​(WordParser wordParser,
                                                      boolean tolerant)
        Description copied from class: AbstractEncapsulatedExpression
        Determines whether the right parenthesis should be parsed or not by this expression. There is a possible case where this expression should have optional left and right parenthesis. If there is no left parenthesis, then it would most likely mean the right parenthesis does not belong to this expression.
        Overrides:
        shouldParseRightParenthesis in class AbstractEncapsulatedExpression
        Parameters:
        wordParser - The text to parse based on the current position of the cursor
        tolerant - Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries
        Returns:
        true if the right parenthesis should be owned by this expression if it is the next character to scan; false otherwise