Class QueryPosition
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.parser.QueryPosition
-
public final class QueryPosition extends java.lang.ObjectThis object contains the cursor position within the parsed tree and within each of theExpressionfrom the root to the deepest leaf.- Version:
- 2.5
- Author:
- Pascal Filion
- Since:
- 2.3
-
-
Constructor Summary
Constructors Constructor Description QueryPosition(int position)Creates a newQueryPosition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPosition(Expression expression, int position)Adds the position of the cursor within the givenExpressionExpressiongetExpression()Returns the childExpressionwhere the position of the cursor is.intgetPosition()Returns the position of the cursor in the query.intgetPosition(Expression expression)Returns the position of the cursor within the givenExpressionvoidsetExpression(Expression expression)Sets the deepest leaf where the cursor is located.java.lang.StringtoString()
-
-
-
Method Detail
-
addPosition
public void addPosition(Expression expression, int position)
Adds the position of the cursor within the givenExpression- Parameters:
expression- AnExpressionin which the cursor is locatedposition- The position of the cursor within the givenExpression
-
getExpression
public Expression getExpression()
Returns the childExpressionwhere the position of the cursor is.- Returns:
- The deepest
Expressionchild 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
public int getPosition(Expression expression)
Returns the position of the cursor within the givenExpression- Parameters:
expression- TheExpressionfor which the position of the cursor is requested- Returns:
- Either the position of the cursor within the given
Expressionor -1 if the cursor is not within it
-
setExpression
public void setExpression(Expression expression)
Sets the deepest leaf where the cursor is located.- Parameters:
expression- TheExpressionthat is the deepest leaf within the parsed tree
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-