01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.geoserver.wfs.kvp;
06:
07: import org.geoserver.ows.KvpParser;
08: import org.geotools.filter.text.cql2.CQL;
09: import org.geotools.filter.text.cql2.CQLException;
10: import org.vfny.geoserver.ServiceException;
11: import java.util.List;
12:
13: /**
14: * Parses the CQL_FILTER parameter into a list of filters
15: * @author Andrea Aime - TOPP
16: *
17: */
18: public class CQLFilterKvpParser extends KvpParser {
19: public CQLFilterKvpParser() {
20: super ("cql_filter", List.class);
21: }
22:
23: public Object parse(String value) throws Exception {
24: try {
25: return CQL.toFilterList(value);
26: } catch (CQLException pe) {
27: throw new ServiceException(
28: "Could not parse CQL filter list."
29: + pe.getMessage(), pe);
30: }
31: }
32: }
|