ExpressionFactory, JPQLGrammar
| Modifier and Type | Class and Description |
|---|---|
| private static class | AbstractExpression.Info
Rather than creating three lists when performing a single parsing operation ( |
| Modifier and Type | Field and Description |
|---|---|
| private String | actualText
The string representation of this |
| private List | children
The children of this |
| public static final char | COMMA
The constant for ','. |
| public static final char | DOT
The constant for '.'. |
| public static final char | DOUBLE_QUOTE
The constant for '"'. |
| public static final char | LEFT_CURLY_BRACKET
The constant for '{'. |
| public static final char | LEFT_PARENTHESIS
The constant for '('. |
| public static final char | NOT_DEFINED
The constant for a character that is not defined. |
| private int | offset
The position of this |
| private List | orderedChildren
The string representation of this |
| private AbstractExpression | parent
The parent of this |
| private String | parsedText
The string representation of this |
| public static final char | RIGHT_CURLY_BRACKET
The constant for '}'. |
| public static final char | RIGHT_PARENTHESIS
The constant for ')'. |
| public static final char | SINGLE_QUOTE
The constant for '''. |
| public static final char | SPACE
The constant for ' '. |
| private String | text
This attribute can be used to store the |
| public static final char | UNDERSCORE
The constant for '_'. |
| Access | Constructor and Description |
|---|---|
| protected | AbstractExpression(AbstractExpression
The parent of this expression parent)Creates a new |
| protected | AbstractExpression(AbstractExpression
The parent of this expression parent, String The text to be stored in this expression, text)null cannot be passedCreates a new |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | Returns: true if the call was successfully executed; false otherwiseThe visitor)ExpressionVisitor to visit this Expression programmaticallyThe given |
| protected void | acceptUnknownVisitor(ExpressionVisitor
The visitor, Class<?> ExpressionVisitor to visit this Expression programmaticallyThe type found in the hierarchy of the given type, Class<?> ExpressionVisitor that will
be used to retrieve the visit methodThe parameter type of the visit method parameterType)The given |
| protected void | addChildrenTo(Collection<Expression>
The collection used to store the children children)Adds the children of this |
| protected void | addOrderedChildrenTo(List<Expression>
The list used to store the string representation of this children)AbstractExpressionAdds the children of this |
| protected final AbstractExpression | Returns: TheExpression representing the given sub-queryThe 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, JPQLQueryBNF The queryBNF, AbstractExpression JPQLQueryBNF used to determine how to parse from the current
position of the cursor within the JPQL queryThe expression, boolean Expression that has just been parsed or nullDetermines whether the parsing system should be tolerant, meaning if it should
try to parse invalid or incomplete queries tolerant)No factories were found to create an |
| protected final AbstractExpression | |
| protected final Expression | Returns: TheExpression representation of the given identifier where the owning
Expression is this oneThe character to wrap as a value)ExpressionCreates a new |
| protected final Expression | Returns: TheExpression representation of the given identifier where the owning
Expression is this oneThe string to wrap as a value)ExpressionCreates a new |
| protected final AbstractExpression | buildUnknownExpression(String
The text causing the expression to be malformed text)Creates an |
| protected final int | Returns: The length of the string representation for what is coming before the givenExpressionThe expression, int Expression for which its position within the parsed tree needs
to be determinedThe current cursor position within the JPQL query while digging into the tree
until the search reaches the expression length)Calculates the position of the given |
| public final ListIterable | children()
Implements org. Expression.
|
| protected final ExpressionFactory | Returns: Either the fallbackExpressionFactory linked to the given JPQLQueryBNF
or null if none was declaredThe queryBNF)JPQLQueryBNF for which its associated fallback ExpressionFactory
will be searchedRetrieve the |
| public JPQLQueryBNF | findQueryBNF(Expression
The expression)Expression that is a descendant of this oneImplements org. JPQLQueryBNF that represents the fragment of this Expression
that was used when parsing the given Expression.
|
| protected final ExpressionFactory | Returns: TheExpressionFactory mapped with the given unique identifierThe unique identifier of the expressionFactoryId)ExpressionFactory to retrieveRetrieves the registered |
| protected final ExpressionRegistry | Returns: The registry containing the information related to the JPQL grammarReturns the registry containing the |
| public JPQLGrammar | getGrammar()
Implements org. JPQLGrammar that defines how the JPQL query was parsed.
|
| public JPAVersion | Returns: The version in which the identifier was introducedRetrieves the JPA version in which the identifier was first introduced. |
| protected JPAVersion | Returns: The JPA version supported by the grammarReturns the version of the Java Persistence to support. |
| public final int | getLength()
Implements org. Expression, which is the
length of the text generated by toActualText().
|
| public final int | getOffset()
Implements org. Expression within its parent hierarchy.
|
| public final AbstractExpression | getParent()
Implements org. Expression.
|
| public JPQLQueryBNF | Returns: TheJPQLQueryBNF representing a section of the grammarThe unique identifier of the queryBNFID)JPQLQueryBNF to retrieveRetrieves the BNF object that was registered for the given unique identifier. |
| public final JPQLExpression | getRoot()
Implements org. |
| protected String | Returns: Either the JPQL identifier for thisAbstractExpression, the literal it
encapsulates or an empty stringReturns the encapsulated text of this |
| protected boolean | Returns: true if the given BNF handles aggregate expressions; false
otherwiseThe queryBNF)JPQLQueryBNF used to determine if the parsing should handle
aggregate expressionsDetermines whether the given |
| protected boolean | Returns: true if the sub-expression to parse might have several sub-expressions
separated by commas; false otherwiseThe queryBNF)JPQLQueryBNF used to determine if the parsing should handle
collection of sub-expressionsDetermines whether the given |
| public boolean | isAncestor(Expression
The expression)Expression to verify its paternity with this ExpressionImplements org. Expression is a parent of the given Expression.
|
| protected final boolean | Returns: true if the word is an identifier, false otherwiseThe word to test if it is a JPQL identifier word)Determines if the given word is a JPQL identifier. |
| protected boolean | Returns: false by defaultDetermines whether this expression is a |
| protected boolean | Returns: true if the text no longer can't be parsed by the current expression;
false if more can be parsedThe 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 parsedDetermines whether the parsing is complete based on what is left in the given text. |
| protected boolean | Returns: true if the parsing system should parse invalid or incomplete queries;
false when the query is well-formed and validDetermines if the parser is in tolerant mode or is in fast mode. |
| protected boolean | Returns: false by defaultDetermines whether this expression is an unknown |
| protected boolean | Returns: true if this AbstractExpression was virtually created to fully
qualify path expression; false if it was parsedDetermines whether this |
| public final ListIterable | orderedChildren()
Implements org. Expression and its children.
|
| protected abstract void | parse(WordParser
The text to parse based on the current position of the cursor wordParser, boolean Determines whether the parsing system should be tolerant, meaning if it should
try to parse invalid or incomplete queries tolerant)Parses the query by starting at the current position, which is part of the given |
| protected AbstractExpression | Returns: TheExpression representing the given sub-queryThe text to parse based on the current position of the cursor wordParser, String The unique identifier of the queryBNFId, boolean JPQLQueryBNF that is used to determine
how to parse the text at the current cursor position within the JPQL queryDetermines whether the parsing system should be tolerant, meaning if it should
try to parse invalid or incomplete queries tolerant)Parses the given text by using the specified BNF. |
| protected AbstractExpression | Returns: TheExpression representing the given sub-queryThe text to parse based on the current position of the cursor wordParser, String The unique identifier of the queryBNFId, boolean JPQLQueryBNF that is used to determine
how to parse the text at the current cursor position within the JPQL queryDetermines whether the parsing system should be tolerant, meaning if it should
try to parse invalid or incomplete queries tolerant)Right away parses the text by retrieving the |
| public void | populatePosition(QueryPosition queryPosition, int
The array has one element and is the position of the position)Expression to retrieveImplements org. Expression located at the given position using the actual query,
which may have extra whitespace.
|
| protected final void | |
| protected final void | |
| protected final void | setParent(AbstractExpression
The new parent of this object parent)Re-parents this |
| protected final void | setText(String
The immutable text wrapped by this text)Expression, which cannot be nullSets the text of this |
| protected boolean | Returns: true is returned by default so the factories are used before falling backDetermines whether the parsing of the query should be performed using the |
| protected boolean | Returns: trueThe expression)Expression that has just been parsed or nullWhen parsing an invalid or incomplete query, it is possible two literals would be parsed but in some cases, a CollectionExpression should not be created and the parsing should actually stop here. |
| public String | toActualText()
Implements org. Expression, which needs 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.
|
| public String | toParsedText()
Implements org. Expression and its children.
|
| protected abstract void | toParsedText(StringBuilder
The buffer used to append this writer, boolean Expression's string representationDetermines 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 actual)Generates a string representation of this |
| public final String |