Class Filler<T>
- All Implemented Interfaces:
Executable,Runnable
- Direct Known Subclasses:
ObjectFiller,Test.F
- Author:
- Syam
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateLinkData(ODT.Table table) Create the data for a link table.voidcustomizeImage(ODT.Image image) Allows customization of an image before it is generated.voidcustomizeSection(ODT.Section section) Allows customization of a section before it is generated.voidcustomizeTable(ODT.Table table) Allows customization of a table before it is generated.evaluate(ODT.Element element, String variableName) Evaluates the given variable to determine a corresponding value.Evaluates the specified attribute of the given object and returns the result.voidexecute()The functional interface method specified by this interface.voidSet and execute the ODT instance associated with this filler.final ODT<?> getODT()Gets the ODT instance currently associated with this filler.Retrieves the reporting object associated with this instance.final TransactionManagerGet the transaction manager associated with the ODT.voidpopulateLinkTable(ODT.Table table) Populate the data for a link table.voidsetImageCustomizer(BiConsumer<Filler<?>, ODT.Image> imageCustomizer) Sets a customizer for images that enables tailored modifications or adjustments during their generation.voidsetReportingObject(T reportingObject) Sets the reporting object for this instance.voidsetSectionCustomizer(BiConsumer<Filler<?>, ODT.Section> sectionCustomizer) Sets a customizer for sections that enables tailored modifications or adjustments during their generation.voidsetTableCustomizer(BiConsumer<Filler<?>, ODT.Table> tableCustomizer) Sets a customizer for tables that enables tailored modifications or adjustments during their generation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.common.Executable
act, run
-
Constructor Details
-
Filler
public Filler()
-
-
Method Details
-
execute
public void execute()Description copied from interface:ExecutableThe functional interface method specified by this interface.- Specified by:
executein interfaceExecutable
-
execute
Set and execute the ODT instance associated with this filler.- Parameters:
odt- The ODT instance to set and execute.
-
getReportingObject
Retrieves the reporting object associated with this instance. The reporting object can be of any generic typeT.- Returns:
- The reporting object of type
T.
-
setReportingObject
Sets the reporting object for this instance.- Parameters:
reportingObject- The reporting object to set. It can be of any typeT.
-
getTransactionManager
Get the transaction manager associated with the ODT.- Returns:
- Transaction manager associated with the ODT.
-
getODT
Gets the ODT instance currently associated with this filler.- Returns:
- The active
ODTinstance, ornullif this filler is not attached to one.
-
evaluate
Evaluates the specified attribute of the given object and returns the result. The method dynamically invokes the getter method for the specified attribute on the provided object and retrieves its value. If an error occurs during evaluation,nullis returned.- Parameters:
object- The object whose attribute is to be evaluated. Must not be null.attribute- The name of the attribute to be evaluated. Must not be null.- Returns:
- The value of the evaluated attribute, or
nullif an error occurs during evaluation.
-
evaluate
Evaluates the given variable to determine a corresponding value. The method handles special cases for ODT.Image elements and elements not associated with a table cell. If a reporting object is available, the evaluation delegates to that object for further processing if the variable is not inside a table cell.- Parameters:
element- The ODT.Element instance where this variable is located.variableName- The name of the variable to evaluate.- Returns:
- The evaluated result as an Object, or a placeholder string in the format
"variableName = ?"if the value cannot be determined. Returnsnullfor instances of ODT.Image.
-
customizeSection
Allows customization of a section before it is generated.Override this method to adjust the section content, remove it, or apply any other document-specific logic.
Note: If a customizer is set, it will be invoked to perform section-specific adjustments.
- Parameters:
section- The section being customized.
-
setSectionCustomizer
Sets a customizer for sections that enables tailored modifications or adjustments during their generation. The customizer is represented as aBiConsumerthat accepts aFillerinstance and anODT.Section.- Parameters:
sectionCustomizer- ABiConsumerthat defines the customization logic for sections. The first parameter is theFillerinstance associated with the operation, and the second parameter is theODT.Sectionto be customized.
-
setTableCustomizer
Sets a customizer for tables that enables tailored modifications or adjustments during their generation. The customizer is represented as aBiConsumerthat accepts aFillerinstance and anODT.Table.- Parameters:
tableCustomizer- ABiConsumerthat defines the customization logic for tables. The first parameter is theFillerinstance associated with the operation, and the second parameter is theODT.Tableto be customized.
-
customizeImage
Allows customization of an image before it is generated.Override this method to modify image handling or remove the image entirely.
Note: If a customizer is set, it will be invoked to perform image-specific adjustments.
- Parameters:
image- The image being customized.
-
customizeTable
Allows customization of a table before it is generated.Override this method to control table output, row counts, blank rows, or remove the table entirely.
Note: If a customizer is set, it will be invoked to perform table-specific adjustments.
- Parameters:
table- The table being customized.
-
populateLinkTable
Populate the data for a link table.Note: The table name should start with "L:" followed by the link object's class name to be considered a link table.
- Parameters:
table- The table to populate.
-
createLinkData
Create the data for a link table.Note: The table name should start with "L:" followed by the link object's class name to be considered a link table.
- Parameters:
table- The table to populate.- Returns:
- List of linked objects or null if unable to create the link or table is invalid.
-
setImageCustomizer
Sets a customizer for images that enables tailored modifications or adjustments during their generation. The customizer is represented as aBiConsumerthat accepts aFillerinstance and anODT.Image.- Parameters:
imageCustomizer- ABiConsumerthat defines the customization logic for images. The first parameter is theFillerinstance associated with the operation, and the second parameter is theODT.Imageto be customized.
-