org.htmlparser.filters
public class StringFilter extends Object implements NodeFilter
| Field Summary | |
|---|---|
| protected boolean | mCaseSensitive
Case sensitive toggle.
|
| protected Locale | mLocale
The locale to use converting to uppercase in case insensitive searches. |
| protected String | mPattern
The string to search for. |
| protected String | mUpperPattern
The string to really search for (converted to uppercase if necessary). |
| Constructor Summary | |
|---|---|
| StringFilter()
Creates a new instance of StringFilter that accepts all string nodes. | |
| StringFilter(String pattern)
Creates a StringFilter that accepts text nodes containing a string.
| |
| StringFilter(String pattern, boolean sensitive)
Creates a StringFilter that accepts text nodes containing a string. | |
| StringFilter(String pattern, boolean sensitive, Locale locale)
Creates a StringFilter that accepts text nodes containing a string. | |
| Method Summary | |
|---|---|
| boolean | accept(Node node)
Accept string nodes that contain the string. |
| boolean | getCaseSensitive()
Get the case sensitivity. |
| Locale | getLocale()
Get the locale for uppercase conversion. |
| String | getPattern()
Get the search pattern. |
| void | setCaseSensitive(boolean sensitive)
Set case sensitivity on or off. |
| void | setLocale(Locale locale)
Set the locale for uppercase conversion. |
| void | setPattern(String pattern)
Set the search pattern. |
| protected void | setUpperPattern()
Set the real (upper case) comparison string. |
true strings are compared with case sensitivity.Locale.Parameters: pattern The pattern to search for.
Parameters: pattern The pattern to search for. sensitive If true, comparisons are performed
respecting case, with conversions done using the default
Locale.
Parameters: pattern The pattern to search for. sensitive If true, comparisons are performed
respecting case. locale The locale to use when converting to uppercase.
If null, the default Locale is used.
Parameters: node The node to check.
Returns: true if node is a Text node
and contains the pattern string, false otherwise.
Returns: Returns the case sensitivity.
Returns: Returns the locale.
Returns: Returns the pattern.
Parameters: sensitive If false searches for the
string are case insensitive.
Parameters: locale The locale to set.
Parameters: pattern The pattern to set.
| HTML Parser is an open source library released under LGPL. | |