Class TableRowsFilter

java.lang.Object
org.silverpeas.components.jdbcconnector.control.TableRowsFilter

public class TableRowsFilter extends Object
Filter of table rows by applying a FieldValueComparator predicate on them.
Author:
mmoquillon
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Default value when no comparator or no field name are set.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears all the filtering parameters used by this filter.
    Filters the specified table rows by applying the underlying filtering parameters that were set by the setters.
    static Set<String>
    Gets the symbol of all the comparators supported by this filter.
    Gets the symbol of the comparator used in the filtering of the SQL query result.
    Gets the name of the field to filter.
    Gets the reference field value, that is the value with which the field of all table rows in the result will be filtered.
    void
    setComparator(String comparatorSymbol)
    Sets the current comparator to use in the filtering of the SQL query result.
    void
    setFieldName(String fieldName, Class<?> fieldType)
    Sets the name of the field, and its concrete type, in each table row of a result to filter.
    void
    setFieldValue(String fieldValue)
    Sets the value with which a field of all the table row will be filtered.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • FIELD_NONE

      public static final String FIELD_NONE
      Default value when no comparator or no field name are set.
      See Also:
  • Constructor Details

    • TableRowsFilter

      public TableRowsFilter()
  • Method Details

    • getAllComparators

      public static Set<String> getAllComparators()
      Gets the symbol of all the comparators supported by this filter.
      Returns:
      a set of comparator symbols.
    • setComparator

      public void setComparator(String comparatorSymbol)
      Sets the current comparator to use in the filtering of the SQL query result.
      Parameters:
      comparatorSymbol - the symbol of a supported comparator.
    • setFieldName

      public void setFieldName(String fieldName, Class<?> fieldType)
      Sets the name of the field, and its concrete type, in each table row of a result to filter.
      Parameters:
      fieldName - the name of a field in the table rows of a SQL query result.
      fieldType - the concrete type of the field.
    • setFieldValue

      public void setFieldValue(String fieldValue)
      Sets the value with which a field of all the table row will be filtered.
      Parameters:
      fieldValue - the value with which the field of each table row will be compared.
    • getComparator

      public String getComparator()
      Gets the symbol of the comparator used in the filtering of the SQL query result.
      Returns:
      the symbol of a supported comparator.
    • getFieldName

      public String getFieldName()
      Gets the name of the field to filter.
      Returns:
      a field name.
    • getFieldValue

      public String getFieldValue()
      Gets the reference field value, that is the value with which the field of all table rows in the result will be filtered.
      Returns:
      the value used in the filtering as a String instance.
    • clear

      public void clear()
      Clears all the filtering parameters used by this filter.
    • filter

      public List<TableRow> filter(List<TableRow> rows)
      Filters the specified table rows by applying the underlying filtering parameters that were set by the setters.
      Parameters:
      rows - the rows to filter.
      Returns:
      a list with all the table rows filtered according to the underlying filtering parameters.