Search in sources :

Example 1 with Expression

use of org.geotools.filter.Expression in project ddf by codice.

the class OpenSearchFilterVisitor method visit.

/**
     * PropertyIsEqualTo filter maps to a type/version criteria.
     */
@Override
public Object visit(PropertyIsEqualTo filter, Object data) {
    LOGGER.trace("ENTERING: PropertyIsEqualTo filter");
    if (currentNest != NestedTypes.NOT) {
        if (filter instanceof IsEqualsToImpl) {
            IsEqualsToImpl isEqualsTo = (IsEqualsToImpl) filter;
            Expression leftValue = isEqualsTo.getLeftValue();
            if (Metacard.ID.equals(leftValue.toString())) {
                id = isEqualsTo.getExpression2().toString();
            }
        } else if (filter instanceof PropertyIsEqualToLiteral) {
            PropertyIsEqualToLiteral isEqualsTo = (PropertyIsEqualToLiteral) filter;
            if (Metacard.ID.equals(isEqualsTo.getExpression1().toString())) {
                id = isEqualsTo.getExpression2().toString();
            }
        }
    }
    filters.add(filter);
    LOGGER.trace("EXITING: PropertyIsEqualTo filter");
    return super.visit(filter, data);
}
Also used : Expression(org.geotools.filter.Expression) IsEqualsToImpl(org.geotools.filter.IsEqualsToImpl) PropertyIsEqualToLiteral(ddf.catalog.filter.impl.PropertyIsEqualToLiteral)

Aggregations

PropertyIsEqualToLiteral (ddf.catalog.filter.impl.PropertyIsEqualToLiteral)1 Expression (org.geotools.filter.Expression)1 IsEqualsToImpl (org.geotools.filter.IsEqualsToImpl)1