Class FieldBasedRowFormatter


  • public class FieldBasedRowFormatter
    extends RowFormatter
    Default implementation of the RowFormatter that uses the fields of an object as columns of the table
    • Constructor Summary

      Constructors 
      Constructor Description
      FieldBasedRowFormatter​(java.lang.Class<?> type, java.lang.String parameterName, Table tableAnnotation, java.lang.annotation.Annotation[] annotations)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> formatRow​(java.lang.Object object)
      Generates a single row of the data table for the given object.
      java.util.List<java.lang.String> header()
      Generates the header row of the data table
      java.util.List<java.util.List<java.lang.String>> postProcess​(java.util.List<java.util.List<java.lang.String>> list)
      Allows for post processing the resulting data table.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FieldBasedRowFormatter

        public FieldBasedRowFormatter​(java.lang.Class<?> type,
                                      java.lang.String parameterName,
                                      Table tableAnnotation,
                                      java.lang.annotation.Annotation[] annotations)
    • Method Detail

      • header

        public java.util.List<java.lang.String> header()
        Description copied from class: RowFormatter
        Generates the header row of the data table
        Specified by:
        header in class RowFormatter
      • formatRow

        public java.util.List<java.lang.String> formatRow​(java.lang.Object object)
        Description copied from class: RowFormatter
        Generates a single row of the data table for the given object. This method is called for each object of the input.
        Specified by:
        formatRow in class RowFormatter
      • postProcess

        public java.util.List<java.util.List<java.lang.String>> postProcess​(java.util.List<java.util.List<java.lang.String>> list)
        Description copied from class: RowFormatter
        Allows for post processing the resulting data table. The default implementation just returns the provided list
        Overrides:
        postProcess in class RowFormatter
        Parameters:
        list - the table that has been generated by calls to the RowFormatter.header() and the RowFormatter.formatRow(Object) methods
        Returns:
        a potentially new table or just the passed table