Package com.nuix.nx.filters
Class DynamicTableFilterProvider
- java.lang.Object
-
- com.nuix.nx.filters.DynamicTableFilterProvider
-
public abstract class DynamicTableFilterProvider extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description DynamicTableFilterProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
afterFiltering()
Called once after filtering.void
beforeFiltering(java.lang.String filterExpression, java.util.List<java.lang.Object> allRecords)
Invoked once before filtering begins, allowing for up front work to be performed that might then be leveraged in subsequent calls tokeepRecord(int, boolean, String, Object, Map)
.abstract boolean
handlesExpression(java.lang.String filterExpression)
Whether this filter provider handles the given filter expression.abstract boolean
keepRecord(int sourceIndex, boolean isChecked, java.lang.String filterExpression, java.lang.Object record, java.util.Map<java.lang.String,java.lang.Object> rowValues)
IfhandlesExpression(String)
returns true, this method will be invoked for each record.
-
-
-
Method Detail
-
handlesExpression
public abstract boolean handlesExpression(java.lang.String filterExpression)
Whether this filter provider handles the given filter expression. If true is returned,keepRecord(int, boolean, String, Object, Map)
will be called for each record to determine whether the given record is filtered out or not. If false is returned then the dynamic table model will continue looking for a filter handler. Filter expression should never be null or an all whitespace or empty string sinceDynamicTableModel
has built in logic to handle that before asking filters.- Parameters:
filterExpression
- The expression the user has provided.- Returns:
- True if this filter should handle this expression. False otherwise.
-
keepRecord
public abstract boolean keepRecord(int sourceIndex, boolean isChecked, java.lang.String filterExpression, java.lang.Object record, java.util.Map<java.lang.String,java.lang.Object> rowValues)
IfhandlesExpression(String)
returns true, this method will be invoked for each record. It should return true for records that should make it into the final collection and false for records that should be filtered out.- Parameters:
sourceIndex
- The index of the record in the full un-filtered source collection.isChecked
- Whether the given record is currently checkedfilterExpression
- The filter expression provided by the user. This value should never be null, only whitespace or empty.record
- The record to inspect and make a decision about.rowValues
- A map of the values actual represented as columns in the table. Relies on table model'sDynamicTableValueCallback
.- Returns:
- True to keep the record, false to filter it out.
-
beforeFiltering
public void beforeFiltering(java.lang.String filterExpression, java.util.List<java.lang.Object> allRecords)
Invoked once before filtering begins, allowing for up front work to be performed that might then be leveraged in subsequent calls tokeepRecord(int, boolean, String, Object, Map)
. Override in derived implementation, default implementation does nothing.- Parameters:
filterExpression
- The filter expression that was providedallRecords
- All the of records pre-filtering
-
afterFiltering
public void afterFiltering()
Called once after filtering. Can be used to clean up any resources that may have been created by calls tobeforeFiltering(String, List)
and/orkeepRecord(int, boolean, String, Object, Map)
.
-
-