Expression takes care of parsing an expression that encapsulates two expressions
separated by a comma.
expression ::= <identifier>(first_expression, second_expression)ConcatExpression, ModExpression, NullIfExpression
| Modifier and Type | Field and Description |
|---|---|
| private AbstractExpression | firstExpression
The |
| private boolean | hasComma
Determines whether the comma separating the first and second expression was parsed. |
| private boolean | hasSpaceAfterComma
Determines whether a whitespace is following the comma. |
| private AbstractExpression | secondExpression
The |
| Access | Constructor and Description |
|---|---|
| protected | AbstractDoubleEncapsulatedExpression(AbstractExpression
The parent of this expression parent, String The JPQL identifier that starts this expression identifier)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | acceptChildren(ExpressionVisitor
The visitor)visitor to visit the children of this object.Implements org. Expression.
|
| protected void | addChildrenTo(Collection<Expression>
The collection used to store the children children)Overrides org. AbstractExpression to the given collection.
|
| protected void | addOrderedEncapsulatedExpressionTo(List<Expression>
The list used to store the string representation of the encapsulated children)ExpressionImplements abstract org. Expressions representing the encapsulated Expression.
|
| public final CollectionExpression | Returns: The first and second expressions wrapped by a temporary collectionCreates a new |
| public JPQLQueryBNF | findQueryBNF(Expression
The expression)Expression that is a descendant of this oneOverrides org. Implements org. JPQLQueryBNF that represents the fragment of this Expression
that was used when parsing the given Expression.
|
| public final Expression | Returns: The expression that was parsed representing the first expressionReturns the |
| public final Expression | Returns: The expression that was parsed representing the second expressionReturns the |
| public final boolean | Returns: true if a comma was parsed after the first expression; false
otherwiseDetermines whether the comma was parsed after the first expression. |
| public boolean | hasEncapsulatedExpression()
Implements abstract org. |
| public final boolean | Returns: true if the first expression was parsed; false if it was
not parsedDetermines whether the first expression of the query was parsed. |
| public final boolean | Returns: true if the second expression was parsed; false if it was
not parsedDetermines whether the second expression of the query was parsed. |
| public final boolean | Returns: true if there was a whitespace after the comma; false
otherwiseDetermines whether a whitespace was parsed after the comma. |
| protected boolean | isParsingComplete(WordParser
The text to parse based on the current position of the cursor wordParser, String The word that was retrieved from the given text, which is the first word in the text word, Expression The expression)Expression that has already been parsedOverrides org. |
| protected boolean | Returns: true if the second expression is optional; false if it is
requiredDetermines whether the second expression is optional or not. |
| public abstract String | Returns: The BNF to be used to parse one of the encapsulated expressionThe position of the encapsulated index)Expression that needs to be parsed
within the parenthesis, which starts at position 0Returns the BNF to be used to parse one of the encapsulated expression. |
| protected void | parseEncapsulatedExpression(WordParser
The text to parse based on the current position of the cursor wordParser, int The number of whitespace characters that were parsed after '(' whitespaceCount, boolean Determines whether the parsing system should be tolerant, meaning if it should
try to parse invalid or incomplete queries tolerant)Implements abstract org. WordParser.
|
| protected void | removeEncapsulatedExpression()
Implements abstract org. Expression that was parsed, it should not be part of this one.
|
| protected void | toParsedTextEncapsulatedExpression(StringBuilder
The buffer used to append the encapsulated writer, boolean Expression's string
representationDetermines 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 actual)Implements abstract org. Expression.
|
| firstExpression | back to summary |
|---|---|
| private AbstractExpression firstExpression The | |
| hasComma | back to summary |
|---|---|
| private boolean hasComma Determines whether the comma separating the first and second expression was parsed. | |
| hasSpaceAfterComma | back to summary |
|---|---|
| private boolean hasSpaceAfterComma Determines whether a whitespace is following the comma. | |
| secondExpression | back to summary |
|---|---|
| private AbstractExpression secondExpression The | |
| AbstractDoubleEncapsulatedExpression | back to summary |
|---|---|
| protected AbstractDoubleEncapsulatedExpression(AbstractExpression parent, String identifier) Creates a new
| |
| acceptChildren | back to summary |
|---|---|
| public void acceptChildren(ExpressionVisitor visitor) Implements org. Doc from org. Visits the children of this
This does not traverse the
| |
| addChildrenTo | back to summary |
|---|---|
| protected void addChildrenTo(Collection<Expression> children) Overrides org. Doc from org. Adds the children of this
| |
| addOrderedEncapsulatedExpressionTo | back to summary |
|---|---|
| protected void addOrderedEncapsulatedExpressionTo(List<Expression> children) Implements abstract org. Adds the
| |
| buildCollectionExpression | back to summary |
|---|---|
| public final CollectionExpression buildCollectionExpression() Creates a new
| |
| findQueryBNF | back to summary |
|---|---|
| public JPQLQueryBNF findQueryBNF(Expression expression) Overrides org. Implements org. Doc from org. Retrieves the
| |
| getFirstExpression | back to summary |
|---|---|
| public final Expression getFirstExpression() Returns the
| |
| getSecondExpression | back to summary |
|---|---|
| public final Expression getSecondExpression() Returns the
| |
| hasComma | back to summary |
|---|---|
| public final boolean hasComma() Determines whether the comma was parsed after the first expression.
| |
| hasEncapsulatedExpression | back to summary |
|---|---|
| public boolean hasEncapsulatedExpression() Implements abstract org. Doc from org. Determines whether something was parsed after the left parenthesis.
| |
| hasFirstExpression | back to summary |
|---|---|
| public final boolean hasFirstExpression() Determines whether the first expression of the query was parsed.
| |
| hasSecondExpression | back to summary |
|---|---|
| public final boolean hasSecondExpression() Determines whether the second expression of the query was parsed.
| |
| hasSpaceAfterComma | back to summary |
|---|---|
| public final boolean hasSpaceAfterComma() Determines whether a whitespace was parsed after the comma.
| |
| isParsingComplete | back to summary |
|---|---|
| protected boolean isParsingComplete(WordParser wordParser, String word, Expression expression) Overrides org. Doc from org. Determines whether the parsing is complete based on what is left in the given text. The text is never empty.
| |
| isSecondExpressionOptional | back to summary |
|---|---|
| protected boolean isSecondExpressionOptional() Determines whether the second expression is optional or not.
| |
| parameterExpressionBNF | back to summary |
|---|---|
| public abstract String parameterExpressionBNF(int index) Returns the BNF to be used to parse one of the encapsulated expression.
| |
| parseEncapsulatedExpression | back to summary |
|---|---|
| protected void parseEncapsulatedExpression(WordParser wordParser, int whitespaceCount, boolean tolerant) Implements abstract org. Doc from org. Parses the encapsulated expression by starting at the current position, which is part of the
given
| |
| removeEncapsulatedExpression | back to summary |
|---|---|
| protected void removeEncapsulatedExpression() Implements abstract org. Doc from org. Removes the encapsulated
| |
| toParsedTextEncapsulatedExpression | back to summary |
|---|---|
| protected void toParsedTextEncapsulatedExpression(StringBuilder writer, boolean actual) Implements abstract org. Generates a string representation of the encapsulated
| |