Package com.tngtech.jgiven.format.table
Class FieldBasedRowFormatter
- java.lang.Object
-
- com.tngtech.jgiven.format.table.RowFormatter
-
- com.tngtech.jgiven.format.table.FieldBasedRowFormatter
-
public class FieldBasedRowFormatter extends RowFormatter
Default implementation of theRowFormatter
that uses the fields of an object as columns of the table
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FieldBasedRowFormatter.Factory
Factory for creating instances ofFieldBasedRowFormatter
-
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 tablejava.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.
-
-
-
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 classRowFormatter
-
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 classRowFormatter
-
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 classRowFormatter
- Parameters:
list
- the table that has been generated by calls to theRowFormatter.header()
and theRowFormatter.formatRow(Object)
methods- Returns:
- a potentially new table or just the passed table
-
-