Search in sources :

Example 1 with FilterExpressionCheckEvaluationVisitor

use of com.yahoo.elide.core.filter.visitors.FilterExpressionCheckEvaluationVisitor in project elide by yahoo.

the class FilterExpressionCheck method ok.

/**
 * The filter expression is evaluated in memory if it cannot be pushed to the data store by elide for any reason.
 *
 * @param object object returned from datastore
 * @param requestScope Request scope object
 * @param changeSpec Summary of modifications
 * @return true if the object pass evaluation against FilterExpression.
 */
@Override
public final boolean ok(T object, RequestScope requestScope, Optional<ChangeSpec> changeSpec) {
    EntityDictionary dictionary = coreScope(requestScope).getDictionary();
    Type<?> entityClass = dictionary.lookupBoundClass(EntityDictionary.getType(object));
    FilterExpression filterExpression = getFilterExpression(entityClass, requestScope);
    return filterExpression.accept(new FilterExpressionCheckEvaluationVisitor(object, this, requestScope));
}
Also used : FilterExpression(com.yahoo.elide.core.filter.expression.FilterExpression) EntityDictionary(com.yahoo.elide.core.dictionary.EntityDictionary) FilterExpressionCheckEvaluationVisitor(com.yahoo.elide.core.filter.visitors.FilterExpressionCheckEvaluationVisitor)

Aggregations

EntityDictionary (com.yahoo.elide.core.dictionary.EntityDictionary)1 FilterExpression (com.yahoo.elide.core.filter.expression.FilterExpression)1 FilterExpressionCheckEvaluationVisitor (com.yahoo.elide.core.filter.visitors.FilterExpressionCheckEvaluationVisitor)1