F
- The type of field description used in parsed QueryFilter
objects.public abstract class QueryFilterParser<F> extends Object
Expr = OrExpr OrExpr = AndExpr ( 'or' AndExpr ) * AndExpr = NotExpr ( 'and' NotExpr ) * NotExpr = '!' PrimaryExpr | PrimaryExpr PrimaryExpr = '(' Expr ')' | ComparisonExpr | PresenceExpr | LiteralExpr ComparisonExpr = Pointer OpName Value PresenceExpr = Pointer 'pr' LiteralExpr = 'true' | 'false' Pointer = Case-sensitive field specification OpName = 'eq' | # equal to 'co' | # contains 'sw' | # starts with 'lt' | # less than 'le' | # less than or equal to 'gt' | # greater than 'ge' | # greater than or equal to STRING # extended operator Value = NUMBER | BOOLEAN | '"' UTF8STRING '"' | ''' UTF8STRING ''' STRING = ASCII string not containing white-space UTF8STRING = UTF-8 string possibly containing white-spaceNote that white space, parentheses, and exclamation characters need URL when passed via HTTP query strings.
ASCII and UTF-8 strings will treat the backslash character as an escape character. For an example, this will allow for the inclusion of quotes or single-quotes within a string that is surrounded by the same type of quotes: "tes\"t". The backslash character itself will also need to be escaped if it is to be included in the string.
In addition to single valued properties (number, boolean, and string), query filters can be applied to multi-valued properties. When operating on properties that are an array or list type the operation should be evaluated on each element in the array, passing if any of the elements in the array or list pass the operation.
Constructor and Description |
---|
QueryFilterParser() |
Modifier and Type | Method and Description |
---|---|
protected abstract F |
parseField(String fieldDescription)
Parses the field description from the current filter token into the type of field
description the QueryFilter uses.
|
QueryFilter<F> |
valueOf(String string)
Parses the provided string representation of a query filter as a
QueryFilter . |
protected abstract F parseField(String fieldDescription)
fieldDescription
- The token from parsing the query string.public QueryFilter<F> valueOf(String string)
QueryFilter
.string
- The string representation of a query filter .QueryFilter
.IllegalArgumentException
- If string
is not a valid string representation of a
query filter.Copyright 2010-2018 ForgeRock AS.