expression ::= CAST(scalar_expression [AS] database_type)DatabaseType
| Modifier and Type | Field and Description |
|---|---|
| private String | asIdentifier
The actual AS identifier found in the string representation of the JPQL query. |
| private AbstractExpression | databaseType
The |
| private boolean | hasSpaceAfterAs
Determines whether a space was parsed after the identifier AS. |
| private boolean | hasSpaceAfterExpression
Determines whether a space was parsed after the expression. |
| private boolean | parsingDatabaseType
Flag used to determine how to stop parsing based on what is being parsed. |
| private boolean | shouldParseWithFactoryFirst
This flag is used to prevent the parsing from using any |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(ExpressionVisitor
The visitor)ExpressionVisitor to visit this objectImplements org. Expression by the given visitor.
|
| protected void | addOrderedEncapsulatedExpressionTo(List<Expression>
The list used to store the string representation of the encapsulated children)
Adds the ExpressionExpressions representing the encapsulated Expression.
|
| public Expression | Returns: TheExpression representing the database typeReturns the database type to cast to. |
| public String | getEncapsulatedExpressionQueryBNFId()
Implements abstract org. |
| public JPQLQueryBNF | getQueryBNF()
Implements org. Expression.
|
| public boolean | Returns: true if the identifier AS was parsed; false otherwiseDetermines whether the identifier AS was part of the query. |
| public boolean | Returns: true if the database type was parsed; false otherwiseDetermines whether the database type was parsed or not. |
| public boolean | hasEncapsulatedExpression()
Determines whether something was parsed after the left parenthesis.
|
| public boolean | Returns: true the expression to be cast was parsed; false otherwiseDetermines whether something was parsed after the left parenthesis and before the
|
| public boolean | Returns: true if there was a whitespace parsed after AS;
false otherwiseDetermines whether a whitespace parsed after AS. |
| public boolean | Returns: true if there was a whitespace parsed after the expression;
false otherwiseDetermines whether a whitespace was parsed after the expression. |
| 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 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)
Parses the encapsulated expression by starting at the current position, which is part of the
given WordParser.
|
| protected void | removeEncapsulatedExpression()
Removes the encapsulated
Expression that was parsed, it should not be part of this one.
|
| protected boolean | shouldParseWithFactoryFirst()
Overrides org. factories first or it should automatically fallback to the fallback factory.
|
| 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)
Generates a string representation of the encapsulated Expression.
|
| asIdentifier | back to summary |
|---|---|
| private String asIdentifier The actual AS identifier found in the string representation of the JPQL query. | |
| databaseType | back to summary |
|---|---|
| private AbstractExpression databaseType The | |
| hasSpaceAfterAs | back to summary |
|---|---|
| private boolean hasSpaceAfterAs Determines whether a space was parsed after the identifier AS. | |
| hasSpaceAfterExpression | back to summary |
|---|---|
| private boolean hasSpaceAfterExpression Determines whether a space was parsed after the expression. | |
| parsingDatabaseType | back to summary |
|---|---|
| private boolean parsingDatabaseType Flag used to determine how to stop parsing based on what is being parsed. | |
| shouldParseWithFactoryFirst | back to summary |
|---|---|
| private boolean shouldParseWithFactoryFirst This flag is used to prevent the parsing from using any | |
| CastExpression | back to summary |
|---|---|
| public CastExpression(AbstractExpression parent) Creates a new
| |
| accept | back to summary |
|---|---|
| public void accept(ExpressionVisitor visitor) Implements org. Doc from org. Visits this
| |
| addOrderedEncapsulatedExpressionTo | back to summary |
|---|---|
| protected void addOrderedEncapsulatedExpressionTo(List<Expression> children) Adds the
| |
| getDatabaseType | back to summary |
|---|---|
| public Expression getDatabaseType() Returns the database type to cast to.
| |
| getEncapsulatedExpressionQueryBNFId | back to summary |
|---|---|
| public String getEncapsulatedExpressionQueryBNFId() Implements abstract org. Returns the BNF used to parse the encapsulated expression. | |
| getQueryBNF | back to summary |
|---|---|
| public JPQLQueryBNF getQueryBNF() Implements org. Doc from org. Returns the BNF of this
| |
| hasAs | back to summary |
|---|---|
| public boolean hasAs() Determines whether the identifier AS was part of the query.
| |
| hasDatabaseType | back to summary |
|---|---|
| public boolean hasDatabaseType() Determines whether the database type was parsed or not.
| |
| hasEncapsulatedExpression | back to summary |
|---|---|
| public boolean hasEncapsulatedExpression() Doc from org. Determines whether something was parsed after the left parenthesis.
| |
| hasScalarExpression | back to summary |
|---|---|
| public boolean hasScalarExpression() Determines whether something was parsed after the left parenthesis and before the
| |
| hasSpaceAfterAs | back to summary |
|---|---|
| public boolean hasSpaceAfterAs() Determines whether a whitespace parsed after AS.
| |
| hasSpaceAfterExpression | back to summary |
|---|---|
| public boolean hasSpaceAfterExpression() Determines whether a whitespace was parsed after the expression.
| |
| 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.
| |
| parseEncapsulatedExpression | back to summary |
|---|---|
| protected void parseEncapsulatedExpression(WordParser wordParser, int whitespaceCount, boolean tolerant) 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() Doc from org. Removes the encapsulated
| |
| shouldParseWithFactoryFirst | back to summary |
|---|---|
| protected boolean shouldParseWithFactoryFirst() Overrides org. Doc from org. Determines whether the parsing of the query should be performed using the
| |
| toParsedTextEncapsulatedExpression | back to summary |
|---|---|
| protected void toParsedTextEncapsulatedExpression(StringBuilder writer, boolean actual) Generates a string representation of the encapsulated
| |