Package com.storedobject.pdf
Class PDF.ObjectTable<T extends StoredObject>
java.lang.Object
com.storedobject.pdf.PDFTable
com.storedobject.pdf.PDF.ObjectTable<T>
- Type Parameters:
T
- Class type of theStoredObject
instance
- All Implemented Interfaces:
PDFElement
- Enclosing class:
PDF
Define a table where
StoredObject
instances can be added as rows.-
Field Summary
Fields inherited from interface com.storedobject.pdf.PDFElement
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, TEXT_DIRECTION_DEFAULT, TEXT_DIRECTION_LTR, TEXT_DIRECTION_NO_BIDI, TEXT_DIRECTION_RTL
-
Constructor Summary
ConstructorsConstructorDescriptionObjectTable
(Class<T> objectClass, boolean withHeadings, StringList attributes) Create a table for the given type ofStoredObject
class.ObjectTable
(Class<T> objectClass, boolean withHeadings, String... attributes) Create a table for the given type ofStoredObject
class.ObjectTable
(Class<T> objectClass, StringList attributes) Create a table for the given type ofStoredObject
class.ObjectTable
(Class<T> objectClass, String... attributes) Create a table for the given type ofStoredObject
class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an object instance to the table.void
configureAttribute
(String attribute, Function<T, ?> valueFunction) Configure the given attribute to use the supplied function for obtaining its values instead of the method of the object's class.protected PDFCell
createHeaderCell
(String attribute) Create the header cell.protected PDFCell
createValueCell
(String attribute, Object value) Create the value cell.void
Generate the header row.void
By invoking this method, the output can be made available as stringified (decoded) values.Methods inherited from class com.storedobject.pdf.PDFTable
addBlankCell, addBlankCell, addBlankCell, addBlankCell, addBlankRow, addBlankRow, addBlankRow, addBlankRow, addBlankRow, addBlankRow, addCell, addCell, addCell, addCell, addCell, addRowCell, addRowCell, deleteBodyRows, deleteLastRow, deleteRow, getAbsoluteWidths, getChunks, getDefaultCell, getFooterHeight, getFooterRows, getHeaderHeight, getHeaderRows, getHorizontalAlignment, getKeepTogether, getNumberOfColumns, getNumberOfRows, getRowHeight, getTextDirection, getTotalHeight, getTotalWidth, getWidthPercentage, isComplete, isSkipFirstHeader, isSkipLastFooter, isSplitRows, setBorderWidth, setBorderWidthBottom, setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, setBreakPoints, setComplete, setFooterRows, setHeaderRows, setHorizontalAlignment, setKeepTogether, setSkipFirstHeader, setSkipLastFooter, setSplitRows, setTextDirection, setTotalWidth, setTotalWidth, setWidthPercentage, setWidthPercentage, setWidths, setWidths
-
Constructor Details
-
ObjectTable
Create a table for the given type ofStoredObject
class.- Parameters:
objectClass
- Object classattributes
- List of attributes to be reported
-
ObjectTable
Create a table for the given type ofStoredObject
class.- Parameters:
objectClass
- Object classattributes
- List of attributes to be reported
-
ObjectTable
Create a table for the given type ofStoredObject
class.- Parameters:
objectClass
- Object classwithHeadings
- Whether header columns to be created automatically or notattributes
- List of attributes to be reported
-
ObjectTable
Create a table for the given type ofStoredObject
class.- Parameters:
objectClass
- Object classwithHeadings
- Whether header columns to be created automatically or notattributes
- List of attributes to be reported
-
-
Method Details
-
generateHeaderRow
public void generateHeaderRow()Generate the header row. -
addObject
Add an object instance to the table. This will create one row.- Parameters:
object
- Object to be added.
-
createHeaderCell
-
createValueCell
-
stringifyValues
public void stringifyValues()By invoking this method, the output can be made available as stringified (decoded) values.Note: This needs to be invoked before adding any objects to the table
-
configureAttribute
Configure the given attribute to use the supplied function for obtaining its values instead of the method of the object's class.Note: This needs to be invoked before adding any objects to the table
- Parameters:
attribute
- Name of the attribute to configure.valueFunction
- Function to obtain the attribute value.
-