Class FilterEncodingPreProcessor
- Object
-
- FilterEncodingPreProcessor
-
- All Implemented Interfaces:
FilterVisitor
public class FilterEncodingPreProcessor extends Object implements FilterVisitor
Prepares a filter for XML encoded for interoperability with another system. It will behave differently depending on the compliance level chosen. A new request will have to be made and the features will have to be tested again on the client side if there are any FidFilters in the filter. Consider the following to understand why:and { nullFilter or{ fidFilter nullFilter } }
for strict it would throw an exception, for low it would be left alone, but for Medium it would end up as:and{ nullFilter nullFilter }
and getFids() would return the fids in the fidFilter.So the final filter would (this is not standard but a common implementation) return the results of the and filter as well as all the features that match the fids. Which is more than the original filter would accept.
The XML Document writer can operate at different levels of compliance. The geotools level is extremely flexible and forgiving.
All NOT(FidFilter) are changed to Filter.INCLUDE. So make sure that the filter is processed again on the client with the original filter For a description of the difference Compliance levels that can be used see
- Author:
- Jesse Eichar
-
-
Constructor Summary
Constructors Constructor Description FilterEncodingPreProcessor(Integer complianceLevel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Id
getFidFilter()
Gets the fid filter that contains all the fids.Filter
getFilter()
Returns the filter that can be encoded.boolean
requiresPostProcessing()
Returns true if the filter was one where the request to the server is more general than the actual filter.Object
visit(And filter, Object extraData)
void
visit(BinaryComparisonOperator filter)
void
visit(BinaryLogicOperator filter)
void
visit(ExcludeFilter filter)
Object
visit(ExcludeFilter filter, Object extraData)
VisitFilter.EXCLUDE
(often used during data structure transformations).void
visit(Filter filter)
void
visit(Id filter)
Object
visit(Id filter, Object extraData)
void
visit(IncludeFilter filter)
Object
visit(IncludeFilter filter, Object extraData)
VisitFilter.INCLUDE
(often used during data structure transformations).void
visit(Not filter)
Object
visit(Not filter, Object extraData)
Object
visit(Or filter, Object extraData)
void
visit(PropertyIsBetween filter)
Object
visit(PropertyIsBetween filter, Object extraData)
Object
visit(PropertyIsEqualTo filter, Object extraData)
Object
visit(PropertyIsGreaterThanOrEqualTo filter, Object extraData)
Object
visit(PropertyIsGreaterThan filter, Object extraData)
Object
visit(PropertyIsLessThanOrEqualTo filter, Object extraData)
Object
visit(PropertyIsLessThan filter, Object extraData)
void
visit(PropertyIsLike filter)
Object
visit(PropertyIsLike filter, Object extraData)
Object
visit(PropertyIsNil filter, Object extraData)
Object
visit(PropertyIsNotEqualTo filter, Object extraData)
void
visit(PropertyIsNull filter)
Object
visit(PropertyIsNull filter, Object extraData)
Object
visit(BBOX filter, Object extraData)
Object
visit(Beyond filter, Object extraData)
void
visit(BinarySpatialOperator filter)
Object
visit(Contains filter, Object extraData)
Object
visit(Crosses filter, Object extraData)
Object
visit(Disjoint filter, Object extraData)
Object
visit(DWithin filter, Object extraData)
Object
visit(Equals filter, Object extraData)
Object
visit(Intersects filter, Object extraData)
Object
visit(Overlaps filter, Object extraData)
Object
visit(Touches filter, Object extraData)
Object
visit(Within filter, Object extraData)
Object
visit(After after, Object extraData)
Object
visit(AnyInteracts anyInteracts, Object extraData)
Object
visit(Before before, Object extraData)
Object
visit(Begins begins, Object extraData)
Object
visit(BegunBy begunBy, Object extraData)
Object
visit(During during, Object extraData)
Object
visit(EndedBy endedBy, Object extraData)
Object
visit(Ends ends, Object extraData)
Object
visit(Meets meets, Object extraData)
Object
visit(MetBy metBy, Object extraData)
Object
visit(OverlappedBy overlappedBy, Object extraData)
Object
visit(TContains contains, Object extraData)
Object
visit(TEquals equals, Object extraData)
Object
visit(TOverlaps contains, Object extraData)
protected void
visitCompareFilter(Filter filter)
protected void
visitGeometryFilter(SpatialOperator filter)
protected void
visitLogicFilter(Filter filter)
void
visitLogicFilter(Not filter)
Object
visitNullFilter(Object extraData)
Used to account for anull
filter value.protected Object
visitTemporalFilter(BinaryTemporalOperator filter)
-
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface FilterVisitor
visit
-
-
-
-
Constructor Detail
-
FilterEncodingPreProcessor
public FilterEncodingPreProcessor(Integer complianceLevel)
-
-
Method Detail
-
getFidFilter
public Id getFidFilter()
Gets the fid filter that contains all the fids.- Returns:
- the fid filter that contains all the fids.
-
getFilter
public Filter getFilter()
Returns the filter that can be encoded.- Returns:
- the filter that can be encoded.
-
visit
public void visit(Filter filter)
-
visit
public void visit(PropertyIsBetween filter)
-
visit
public void visit(BinaryComparisonOperator filter)
-
visit
public void visit(Not filter)
-
visit
public void visit(BinarySpatialOperator filter)
-
visit
public void visit(PropertyIsLike filter)
-
visitLogicFilter
public void visitLogicFilter(Not filter)
-
visit
public void visit(BinaryLogicOperator filter)
-
visit
public void visit(PropertyIsNull filter)
-
visit
public void visit(Id filter)
-
visit
public void visit(IncludeFilter filter)
-
visit
public void visit(ExcludeFilter filter)
-
requiresPostProcessing
public boolean requiresPostProcessing()
Returns true if the filter was one where the request to the server is more general than the actual filter. SeeXMLHandlerHints.VALUE_FILTER_COMPLIANCE_MEDIUM
and example of when this can happen.- Returns:
- true if the filter was one where the request to the server is more general than the actual filter.
-
visitLogicFilter
protected void visitLogicFilter(Filter filter)
-
visitCompareFilter
protected void visitCompareFilter(Filter filter)
-
visitGeometryFilter
protected void visitGeometryFilter(SpatialOperator filter)
-
visit
public Object visit(And filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Id filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visitNullFilter
public Object visitNullFilter(Object extraData)
Description copied from interface:FilterVisitor
Used to account for anull
filter value.This is particularly used during data structure transofrmations, however the use of
null
is not recommended. Please make use of Filter.NONE and Filter.ALL as placeholder objects that communicate intent.- Specified by:
visitNullFilter
in interfaceFilterVisitor
- Parameters:
extraData
- Value object provided to visitor- Returns:
- subclass defined
-
visit
public Object visit(IncludeFilter filter, Object extraData)
Description copied from interface:FilterVisitor
VisitFilter.INCLUDE
(often used during data structure transformations).- Specified by:
visit
in interfaceFilterVisitor
- Parameters:
filter
-Filter.INCLUDE
.extraData
- Value object provided to visitor- Returns:
- subclass supplied
-
visit
public Object visit(ExcludeFilter filter, Object extraData)
Description copied from interface:FilterVisitor
VisitFilter.EXCLUDE
(often used during data structure transformations).- Specified by:
visit
in interfaceFilterVisitor
- Parameters:
filter
-Filter.EXCLUDE
.extraData
- Value object provided to visitor- Returns:
- subclass supplied
-
visit
public Object visit(Not filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Or filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(PropertyIsBetween filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(PropertyIsEqualTo filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(PropertyIsNotEqualTo filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(PropertyIsGreaterThan filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(PropertyIsGreaterThanOrEqualTo filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(PropertyIsLessThan filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(PropertyIsLessThanOrEqualTo filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(PropertyIsLike filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(PropertyIsNull filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(PropertyIsNil filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(BBOX filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Beyond filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Contains filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Crosses filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Disjoint filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(DWithin filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Equals filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Intersects filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Overlaps filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Touches filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Within filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(After after, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(AnyInteracts anyInteracts, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Before before, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Begins begins, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(BegunBy begunBy, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(During during, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(EndedBy endedBy, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Ends ends, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(Meets meets, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(MetBy metBy, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(OverlappedBy overlappedBy, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(TContains contains, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(TEquals equals, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visit
public Object visit(TOverlaps contains, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
-
visitTemporalFilter
protected Object visitTemporalFilter(BinaryTemporalOperator filter)
-
-