net.coderazzi.filters
Interface IParser

All Known Implementing Classes:
Parser

public interface IParser

Interface defining the requirements on text parsing for filter expressions.
Starting on version 4.3, the parser is also able to handle html content; in this case, the parser accepts simple text, but the created filter can be applied to Html content

Author:
Luis M Pena - lu@coderazzi.net

Nested Class Summary
static class IParser.InstantFilter
          Helper class used on parseInstantText(String).
 
Method Summary
 String escape(String s)
          Escapes a given expression, such that, when parsed, the parser will make no character/operator substitutions.
 IParser.InstantFilter parseInstantText(String expression)
          Parses the text, considered to be a part of the whole text to enter.
 RowFilter parseText(String expression)
          Parses the text, returning a filter that can be applied to the table.
 String stripHtml(String s)
          Removes any Html content from the passed string, converting special Html characters to Java characters.
 

Method Detail

parseText

RowFilter parseText(String expression)
                    throws ParseException
Parses the text, returning a filter that can be applied to the table.

Parameters:
expression - the text to parse
Throws:
ParseException

parseInstantText

IParser.InstantFilter parseInstantText(String expression)
                                       throws ParseException
Parses the text, considered to be a part of the whole text to enter.

The behaviour of this method is implementation specific; the default implementation considers the expression to be the beginning of the expected final string

This method is invoked when the user inputs text on a filter editor, if instant parsing is enabled, and if the text entered so far does not match any table's row value for the associated column.

Alternative implementations that would consider matching the provided expression to any substring ('contain' meaning), should set the autoCompletion flag in the IFilterEditorto false

Parameters:
expression - the text to parse
Returns:
the filter plus the real expression used to create the filter
Throws:
ParseException

escape

String escape(String s)
Escapes a given expression, such that, when parsed, the parser will make no character/operator substitutions.


stripHtml

String stripHtml(String s)
Removes any Html content from the passed string, converting special Html characters to Java characters.