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

public abstract class EntityQueryParsingException extends RuntimeException
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:
  • Constructor Details

    • EntityQueryParsingException

      public EntityQueryParsingException(String message)
  • 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

      public void setContextExpression(String contextExpression)
      Parameters:
      contextExpression - sub-errorExpression string that was being handled
    • setErrorExpression

      public void setErrorExpression(String errorExpression)
      Parameters:
      errorExpression - most relevant to the exception
    • hasContext

      public boolean hasContext()
      Returns:
      true if contextual errorExpression information is set
    • hasErrorExpressionPosition

      public boolean hasErrorExpressionPosition()
    • getContextExpressionStart

      public int getContextExpressionStart()
    • getErrorExpressionPosition

      public int getErrorExpressionPosition()
    • getContextExpression

      public String getContextExpression()
    • getErrorExpression

      public String getErrorExpression()
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable