|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.data.provider.FilterCriteria
com.sun.data.provider.impl.RegexFilterCriteria
public class RegexFilterCriteria
The RegexFilterCriteria is an implementation of FilterCriteria
that matches a regular expression with the toString()
value of
a FieldKey
in a TableDataProvider
.
Field Summary | |
---|---|
protected java.util.regex.Pattern |
pattern
Storage for the Pattern |
Constructor Summary | |
---|---|
RegexFilterCriteria()
|
|
RegexFilterCriteria(FieldKey fieldKey)
|
|
RegexFilterCriteria(FieldKey fieldKey,
java.lang.String expression)
|
|
RegexFilterCriteria(java.lang.String expression)
|
Method Summary | |
---|---|
java.lang.String |
getDisplayName()
Returns the display name for this filter criteria. |
java.lang.String |
getExpression()
|
FieldKey |
getFieldKey()
|
boolean |
match(TableDataProvider provider,
RowKey row)
This method tests for a pattern match in the toString()
value of the data item stored under the FieldKey at the specified
row. |
void |
setExpression(java.lang.String expression)
|
void |
setFieldKey(FieldKey fieldKey)
|
Methods inherited from class com.sun.data.provider.FilterCriteria |
---|
isInclude, setDisplayName, setInclude |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.regex.Pattern pattern
Pattern
Constructor Detail |
---|
public RegexFilterCriteria()
public RegexFilterCriteria(FieldKey fieldKey)
fieldKey
- FieldKeypublic RegexFilterCriteria(java.lang.String expression) throws java.util.regex.PatternSyntaxException
expression
- String
java.util.regex.PatternSyntaxException
public RegexFilterCriteria(FieldKey fieldKey, java.lang.String expression) throws java.util.regex.PatternSyntaxException
fieldKey
- FieldKeyexpression
- String
java.util.regex.PatternSyntaxException
Method Detail |
---|
public java.lang.String getDisplayName()
FilterCriteria
Returns the display name for this filter criteria.
getDisplayName
in class FilterCriteria
public void setFieldKey(FieldKey fieldKey)
fieldKey
- FieldKeypublic FieldKey getFieldKey()
public void setExpression(java.lang.String expression) throws java.util.regex.PatternSyntaxException
expression
- String
java.util.regex.PatternSyntaxException
public java.lang.String getExpression()
public boolean match(TableDataProvider provider, RowKey row) throws DataProviderException
This method tests for a pattern match in the toString()
value of the data item stored under the FieldKey
at the specified
row. A match is determined using the currently set regular expression.
Determines wether or not a particular row matches this filter criteria. Implementations may perform whatever logic is desired to make this determination. The combination of a positive match and the state of the include property determines if a row is included or excluded from the filter.
match
in class FilterCriteria
provider
- TableDataProvider
containing the data on
displayrow
- The RowKey
of the data to be checked for a match
true
if a match was detected, or
false
if not.
DataProviderException
- Implementations may wish to surface
internal exceptions (nested in DataProviderException) rather
than simply returning null. A DPE may also indicate that the
passed TableDataProvider or RowKey is not valid. Consult the
documentation of the specific FilterCriteria implementation for
details on what exceptions might be wrapped by a DPE.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |