Class BeanQuerySyntaxException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.juneau.commons.BasicRuntimeException
org.apache.juneau.commons.beanquery.BeanQuerySyntaxException
- All Implemented Interfaces:
Serializable
Thrown when a
$-search expression names an unknown operator or is otherwise malformed (an unclosed
parenthesis, a wrong argument count, junk after the close paren, an empty expression, and so on), or when a
higher-level check (column allow-list, sort keys, paging, regex policy, operator/type mismatch, an unparseable
typed value) rejects a caller-supplied query.
The single public parser (SearchExpressionParser) throws this for every syntactic problem; the #1/#2
validation pipeline throws it for every semantic one. Every instance carries a stable BeanQuerySyntaxException.Code: messages are
for people, code() is for callers (an HTTP error body, the JS engine, a test corpus) that need to branch
on *which* problem occurred without parsing the message.
Example:
- Since:
- 10.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumStable identity for aBeanQuerySyntaxException, independent of the (free-text) message. -
Constructor Summary
ConstructorsConstructorDescriptionBeanQuerySyntaxException(BeanQuerySyntaxException.Code code, String message, Object... args) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncode()Returns the stable code identifying which problem occurred.Methods inherited from class org.apache.juneau.commons.BasicRuntimeException
getMessage, setMessageMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
BeanQuerySyntaxException
Constructor.- Parameters:
code- The stableBeanQuerySyntaxException.Codeidentifying which problem occurred. Must not benull .message- TheString.format-style message (%s placeholders).args- OptionalString.format-style arguments.
-
-
Method Details
-
code
Returns the stable code identifying which problem occurred.- Returns:
- The code, never
null .
-