Class DataListHead

java.lang.Object
org.apache.empire.data.list.DataListHead
All Implemented Interfaces:
Serializable

public class DataListHead extends Object implements Serializable
See Also:
  • Field Details

    • columns

      protected final ColumnExpr[] columns
    • columnSeparator

      protected String columnSeparator
  • Constructor Details

    • DataListHead

      public DataListHead(ColumnExpr[] columns)
      Constructs a DataListHead based on an DataListEntry constructor
      Parameters:
      columns - the list entry columns
  • Method Details

    • getColumns

      public ColumnExpr[] getColumns()
    • getColumnIndex

      public int getColumnIndex(ColumnExpr column)
    • getColumnIndex

      public int getColumnIndex(String columnName)
    • getDatabase

      public <T extends DBDatabase> T getDatabase(Class<T> dbClass)
      Returns the database instance associated with this DataList (if any) The database is extracted from the column list
      Type Parameters:
      T - the type of the database
      Parameters:
      dbClass - the desired subclass of DBDatabase
      Returns:
      the database instance or null if no Database instance of this type could be found
    • getText

      public final String getText(int index, Object value)
      Returns the value of a column as a formatted text This converts the value to a string if necessary and performs an options lookup To customize conversion please override convertToString()
      Parameters:
      index - the field index for which to get the formatted value
      value - the value to format
      Returns:
      the formatted value
    • formatValue

      protected String formatValue(ColumnExpr column, Object value)
      Convert a non-string value to a string Overwrite this function in order to provide a locale
      Parameters:
      column - the column expression
      value - the value to format
      Returns:
      the formatted string