net.coderazzi.filters.parser
Class Parser

java.lang.Object
  extended by net.coderazzi.filters.parser.Parser
All Implemented Interfaces:
IParser

public class Parser
extends Object
implements IParser

Basic implementation of a IParser, supporting only simple operators referring to the content of a single column.
The supporter operators include:

In addition, providing no operator will behave as the operator ~, unless the text can be parsed as a (non string) object; in this case, it will behave as operator =.


Constructor Summary
Parser(Format format, Comparator classComparator, Comparator<String> stringComparator, boolean ignoreCase, int modelIndex)
           
 
Method Summary
 String escape(String expression)
          Escapes a given expression, such that, when parsed, the parser will make no character/operator substitutions.
 RowFilter parseText(String expression)
          Parses the text, returning a filter that can be applied to the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser(Format format,
              Comparator classComparator,
              Comparator<String> stringComparator,
              boolean ignoreCase,
              int modelIndex)
Method Detail

parseText

public RowFilter parseText(String expression)
                    throws ParseException
Description copied from interface: IParser
Parses the text, returning a filter that can be applied to the table.

Specified by:
parseText in interface IParser
Parameters:
expression - the text to parse
Throws:
ParseException

escape

public String escape(String expression)
Description copied from interface: IParser
Escapes a given expression, such that, when parsed, the parser will make no character/operator substitutions.

Specified by:
escape in interface IParser


Copyright © 2011 coderazzi. All Rights Reserved.