schmitzm.geotools.feature
Class CQLFilterParser

java.lang.Object
  extended by schmitzm.geotools.feature.CQLFilterParser
All Implemented Interfaces:
FilterParser, ParserOperatorsHints

public class CQLFilterParser
extends Object
implements FilterParser

This parser creates a CQL-Filter from a rule string. It also provides information about available operators and their tooltips.

Author:
Martin Schmitz, Stefan Krüger

Constructor Summary
CQLFilterParser()
          Creates a new parser.
 
Method Summary
 String getOperatorDescription(String operator)
          Returns a description that can be used for a tooltip
 int getOperatorParameterCount(String operator)
          Returns always 0
 Vector<String> getOperators()
          a list of String operators as they may be inserted into the CQL filter.
 String getOperatorTitle(String operator)
          The title as it might be used in the GUI
 Filter parseFilter(String rule)
          Creates a CQL-Filter for the rule string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CQLFilterParser

public CQLFilterParser()
Creates a new parser. CQLFitlerParser.OpDesc.not=NOT CQLFitlerParser.OpDesc.or=OR CQLFitlerParser.OpDesc.and=AND CQLFitlerParser.OpDesc.eq=\= CQLFitlerParser.OpDesc.ne=<> CQLFitlerParser.OpDesc.lt=< CQLFitlerParser.OpDesc.le=<= CQLFitlerParser.OpDesc.gt=> CQLFitlerParser.OpDesc.like=LIKE CQLFitlerParser.OpDesc.ge=>=

Method Detail

parseFilter

public Filter parseFilter(String rule)
Creates a CQL-Filter for the rule string.

Specified by:
parseFilter in interface FilterParser
Parameters:
rule - a rule string
Returns:
Filter.INCLUDE if the rule is empty

getOperatorDescription

public String getOperatorDescription(String operator)
Returns a description that can be used for a tooltip

Specified by:
getOperatorDescription in interface ParserOperatorsHints

getOperatorParameterCount

public int getOperatorParameterCount(String operator)
Returns always 0

Specified by:
getOperatorParameterCount in interface ParserOperatorsHints

getOperatorTitle

public String getOperatorTitle(String operator)
The title as it might be used in the GUI

Specified by:
getOperatorTitle in interface ParserOperatorsHints

getOperators

public Vector<String> getOperators()
a list of String operators as they may be inserted into the CQL filter.

Specified by:
getOperators in interface ParserOperatorsHints