Search in sources :

Example 1 with DslBlockQuery

use of io.vertigo.dynamox.search.dsl.model.DslBlockQuery in project vertigo by KleeGroup.

the class DslMultiQueryRule method handle.

/**
 * {@inheritDoc}
 */
@Override
protected DslBlockQuery handle(final List<Object> parsing) {
    final String preQuery = (String) parsing.get(0);
    final List<DslQuery> queryDefinitions = new ArrayList<>();
    final String postQuery = (String) parsing.get(4);
    final List<PegChoice> manyQueries = (List<PegChoice>) parsing.get(2);
    for (final PegChoice item : manyQueries) {
        queryDefinitions.add((DslQuery) item.getValue());
    }
    return new DslBlockQuery(preQuery, queryDefinitions, postQuery);
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) DslBlockQuery(io.vertigo.dynamox.search.dsl.model.DslBlockQuery) PegChoice(io.vertigo.commons.peg.PegChoice) DslQuery(io.vertigo.dynamox.search.dsl.model.DslQuery)

Aggregations

PegChoice (io.vertigo.commons.peg.PegChoice)1 DslBlockQuery (io.vertigo.dynamox.search.dsl.model.DslBlockQuery)1 DslQuery (io.vertigo.dynamox.search.dsl.model.DslQuery)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1