Class EntityQueryParsingException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.foreach.across.modules.entity.query.EntityQueryParsingException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
EntityQueryParsingException.ExpressionUnbalanced,EntityQueryParsingException.IllegalField,EntityQueryParsingException.IllegalFunction,EntityQueryParsingException.IllegalIsValue,EntityQueryParsingException.IllegalKeyword,EntityQueryParsingException.IllegalOperator,EntityQueryParsingException.IllegalToken,EntityQueryParsingException.IllegalValue
Base class for exceptions thrown by the
EntityQueryTokenConverter.
Returns information on where the exception has occurred in the original query.
The getErrorExpression() and getErrorExpressionPosition() properties give additional information on the
last part of the errorExpression that was handled. Depending on the type of exception the actual error occurred
when handling the last token or not finding the expected token right after (see sub-class EntityQueryParsingException.ExpressionUnbalanced).
The getContextExpression() and getContextExpressionStart() return the sub-errorExpression that was being handled,
usually the entire predicate clause in a query. The position returns the start of the sub-errorExpression clause.- Since:
- 2.0.0
- Author:
- Arne Vandamme
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBase class for unbalanced exception, meaning a token or keyword was expected but not found.static classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintbooleanbooleanvoidsetContextExpression(String contextExpression) voidsetContextExpressionStart(int contextExpressionStart) voidsetErrorExpression(String errorExpression) voidsetErrorExpressionPosition(int errorExpressionPosition) Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
EntityQueryParsingException
-
-
Method Details
-
setContextExpressionStart
public void setContextExpressionStart(int contextExpressionStart) - Parameters:
contextExpressionStart- start of the sub-errorExpression in the original query
-
setErrorExpressionPosition
public void setErrorExpressionPosition(int errorExpressionPosition) - Parameters:
errorExpressionPosition- position most relevant to where the exception occurred
-
setContextExpression
- Parameters:
contextExpression- sub-errorExpression string that was being handled
-
setErrorExpression
- Parameters:
errorExpression- most relevant to the exception
-
hasContext
public boolean hasContext()- Returns:
trueif contextual errorExpression information is set
-
hasErrorExpressionPosition
public boolean hasErrorExpressionPosition() -
getContextExpressionStart
public int getContextExpressionStart() -
getErrorExpressionPosition
public int getErrorExpressionPosition() -
getContextExpression
-
getErrorExpression
-
getMessage
- Overrides:
getMessagein classThrowable
-