Class AbstractSingleEncapsulatedExpression

    • Constructor Detail

      • AbstractSingleEncapsulatedExpression

        protected AbstractSingleEncapsulatedExpression​(AbstractExpression parent,
                                                       java.lang.String identifier)
        Creates a new EncapsulatedExpression.
        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.
        The BNF used to parse the encapsulated expression
      • getExpression

        public final Expression getExpression()
        Returns the Expression that is encapsulated within parenthesis.
        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
        true if something was parsed; false otherwise
      • hasExpression

        public final boolean hasExpression()
        Determines whether the encapsulated expression of the query was parsed.
        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
        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.
        expression - The new encapsulated Expression, which cannot be null
        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
        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