Class NullExpression

  • All Implemented Interfaces:
    Expression

    public final class NullExpression
    extends AbstractExpression
    A null Expression is used instead of a true null, which allows operations to be performed without doing a null check first.
    Version:
    2.5
    Author:
    Pascal Filion
    Since:
    2.3
    • Constructor Detail

      • NullExpression

        public NullExpression​(AbstractExpression parent)
        Creates a new NullExpression.
        Parameters:
        parent - The parent of this NullExpression
    • Method Detail

      • isNull

        public boolean isNull()
        Determines whether this expression is a null Expression or any other subclass.
        Overrides:
        isNull in class AbstractExpression
        Returns:
        false by default
      • parse

        protected void parse​(WordParser wordParser,
                             boolean tolerant)
        Parses the query by starting at the current position, which is part of the given WordParser.
        Specified by:
        parse in class AbstractExpression
        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
      • toParsedText

        protected void toParsedText​(java.lang.StringBuilder writer,
                                    boolean actual)
        Generates a string representation of this Expression, including its children, if it has any.
        Specified by:
        toParsedText in class AbstractExpression
        Parameters:
        writer - The buffer used to append this Expression's string representation
        actual - Determines whether the string representation should represent what was parsed, i.e. include any "virtual" whitespace (such as ending whitespace) and the actual case of the JPQL identifiers