Class QueryPosition
java.lang.Object
org.eclipse.persistence.jpa.jpql.parser.QueryPosition
This object contains the cursor position within the parsed tree and within each of the
Expression
from the root to the deepest leaf.- Since:
- 2.3
- Version:
- 2.5
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPosition
(Expression expression, int position) Adds the position of the cursor within the givenExpression
Returns the childExpression
where the position of the cursor is.int
Returns the position of the cursor in the query.int
getPosition
(Expression expression) Returns the position of the cursor within the givenExpression
void
setExpression
(Expression expression) Sets the deepest leaf where the cursor is located.toString()
-
Constructor Details
-
QueryPosition
public QueryPosition(int position) Creates a newQueryPosition
.- Parameters:
position
- The position of the cursor in the query
-
-
Method Details
-
addPosition
Adds the position of the cursor within the givenExpression
- Parameters:
expression
- AnExpression
in which the cursor is locatedposition
- The position of the cursor within the givenExpression
-
getExpression
Returns the childExpression
where the position of the cursor is.- Returns:
- The deepest
Expression
child that was retrieving by traversing the parsed tree up to the position of the cursor.
-
getPosition
public int getPosition()Returns the position of the cursor in the query.- Returns:
- The position of the cursor in the query
-
getPosition
Returns the position of the cursor within the givenExpression
- Parameters:
expression
- TheExpression
for which the position of the cursor is requested- Returns:
- Either the position of the cursor within the given
Expression
or -1 if the cursor is not within it
-
setExpression
Sets the deepest leaf where the cursor is located.- Parameters:
expression
- TheExpression
that is the deepest leaf within the parsed tree
-
toString
-