Class AbstractSingleEncapsulatedExpression

    • Constructor Detail

      • AbstractSingleEncapsulatedExpression

        protected AbstractSingleEncapsulatedExpression​(AbstractExpression parent,
                                                       java.lang.String identifier)
        Creates a new EncapsulatedExpression.
        Parameters:
        parent - The parent of this expression
        identifier - The JPQL identifier that starts this expression
    • Method Detail

      • getEncapsulatedExpressionQueryBNFId

        public abstract java.lang.String getEncapsulatedExpressionQueryBNFId()
        Returns the BNF used to parse the encapsulated expression.
        Returns:
        The BNF used to parse the encapsulated expression
      • getExpression

        public final Expression getExpression()
        Returns the Expression that is encapsulated within parenthesis.
        Returns:
        The Expression that is encapsulated within parenthesis
      • hasEncapsulatedExpression

        public boolean hasEncapsulatedExpression()
        Determines whether something was parsed after the left parenthesis.
        Specified by:
        hasEncapsulatedExpression in class AbstractEncapsulatedExpression
        Returns:
        true if something was parsed; false otherwise
      • hasExpression

        public final boolean hasExpression()
        Determines whether the encapsulated expression of the query was parsed.
        Returns:
        true if the encapsulated expression was parsed; false if it was not parsed
      • parseEncapsulatedExpression

        protected void parseEncapsulatedExpression​(WordParser wordParser,
                                                   int whitespaceCount,
                                                   boolean tolerant)
        Parses the encapsulated expression by starting at the current position, which is part of the given WordParser.
        Specified by:
        parseEncapsulatedExpression in class AbstractEncapsulatedExpression
        Parameters:
        wordParser - The text to parse based on the current position of the cursor
        whitespaceCount - The number of whitespace characters that were parsed after '('
        tolerant - Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries
      • setExpression

        public final void setExpression​(AbstractExpression expression)
        Manually sets the encapsulated Expression to become the given one.
        Parameters:
        expression - The new encapsulated Expression, which cannot be null
        Throws:
        java.lang.NullPointerException - The given AbstractExpression cannot be null
      • toParsedTextEncapsulatedExpression

        protected void toParsedTextEncapsulatedExpression​(java.lang.StringBuilder writer,
                                                          boolean actual)
        Generates a string representation of the encapsulated Expression.
        Specified by:
        toParsedTextEncapsulatedExpression in class AbstractEncapsulatedExpression
        Parameters:
        writer - The buffer used to append the encapsulated Expression's string representation
        actual - Determines whether to include any characters that are considered virtual, i.e. that was parsed when the query is incomplete and is needed for functionality like content assist