Takes a filter and returns a simplified, equivalent one. At the moment the filter:
- simplifies out {@link Filter#INCLUDE} and {@link Filter#EXCLUDE} in logical expressions
- removes double logic negations
- deal with FID filter validation removing invalid fids
- optimize out all non volatile functions that do not happen to use attributes, replacing them with literals
FID filter validation is meant to wipe out non valid feature ids from {@link Id} filters. This isso in order to avoid sending feature ids down to DataStores that are not valid as per the specific FeatureType fid structure. Since this is structure is usually DataStore specific, some times being a strategy based on how the feature type primary key is generated, fid validation is abstracted out to the {@link FIDValidator} interface so when a DataStore is about to send a querydown to the backend it van provide this visitor with a validator specific for the feature type fid structure being queried.
By default all feature ids are valid. DataStores that want non valid fids to be wiped out should set a {@link FIDValidator} through the {@link #setFIDValidator(FIDValidator)} method.
@author Andrea Aime - OpenGeo
@author Gabriel Roldan (OpenGeo)
@since 2.5.x
@version $Id$
@source $URL$