Возможность собрать значения атрибутов Фильтра до его применения

Добрый день.

Подскажите, пожалуйста, есть ли возможность в каком-то виде собрать пары ключ - значение атрибутов фильтров перед его применением? Есть ли возможность затем прервать поиск и вывести уведомление, например?

Добрый день!
В классе WebFilter есть метод getDelegate(). В JavaDoc этого метода есть пример как сделать то, что вам нужно:

    /**
     * Returns a {@link FilterDelegate} instance. FilterDelegate provides an access to filter internals not available from the high-level filter API.
     * For example, you may get a list of filter parameter and its values. That may be useful if you want to check that all parameters are filled
     * before the filter is applied:
     *
     * <pre>{@code
     *    filter.setBeforeFilterAppliedHandler(() -> {
     *    FilterDelegate delegate = ((WebFilter) filter).getDelegate();
     *        List<AbstractCondition> conditions = delegate.getConditionsTree().toConditionsList();
     *        for (AbstractCondition condition : conditions) {
     *            if (condition.getParam().getValue() == null) {
     *                notifications.create(Notifications.NotificationType.WARNING)
     *                        .withCaption("All parameters must be filled")
     *                        .show();
     *                return false;
     *            }
     *        }
     *        return true;
     *    });
     * }</pre>
     * <p>
     * WARNING: The API of the FilterDelegate is unstable and may be changed.
     */
    public FilterDelegate getDelegate() {
        return delegate;
    }
2 симпатии