Class MapFilterVisitor<F>

java.lang.Object
org.forgerock.util.query.MapFilterVisitor<F>
Type Parameters:
F - The type of field description used in parsed QueryFilter objects.
All Implemented Interfaces:
QueryFilterVisitor<Map<String,Object>,Void,F>

public class MapFilterVisitor<F> extends Object implements QueryFilterVisitor<Map<String,Object>,Void,F>
A QueryFilterVisitor that produces a Map representation of the filter tree.

The produced map is constructed according to the following representation:

an and expression
{ "operator" : "and", "subfilters" : [ the subfilters ] }
an or expression
{ "operator" : "or", "subfilters" : [ the subfilters ] }
a not expression
{ "operator" : "not", "subfilter" : the subfilter }
indicates a complex subfilter expression
{ "operator" : "complex", "field" : "/afield", "subfilter" : the subfilter }
a presence expression
{ "operator" : "pr", "field" : "/afield"}
an equals expression
{ "operator" : "eq", "field" : "/afield", "value" : "something"}
a contains expression
{ "operator" : "co", "field" : "/afield", "value" : "something"}
a starts-with expression
{ "operator" : "sw", "field" : "/afield", "value" : "some"}
a less-than expression
{ "operator" : "lt", "field" : "/afield", "value" : "something"}
a less-than-or-equal-to expression
{ "operator" : "le", "field" : "/afield", "value" : "something"}
a greater-than expression
{ "operator" : "gt", "field" : "/afield", "value" : "something"}
a greater-than-or-equal-to expression
{ "operator" : "ge", "field" : "/afield", "value" : "something"}
Notes:
  1. JSON notation used for convenience to illustrate Map-structure.
    • To produce JSON, use new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(map);
    • Or wrap with JsonValue:
      new org.forgerock.json.JsonValue(map);
  2. Field values are shown in org.forgerock.json.JsonPointer syntax; actual field representation depends on field type of QueryFilter.