public interface TemplateDocument
extends java.lang.AutoCloseable
Template document with analyzed tags. Modifies document in memory and saves changes on close.
If format support streaming, changes will be flushed to output during low level resize operation
Represents abstraction over specific document type (text, Word document, Excel workbook, XML, ...) All such documents are processed with this same API which allows for code reuse across different templates.
Modifier and Type | Method and Description |
---|---|
void |
close()
Finish processing and populate output document.
|
<T> TemplateDocument |
process(T data)
Modifies document according to rules for specified data type.
|
Templater |
templater()
Provides access to the low-level API.
|
Templater templater()
Provides access to the low-level API.
Low-level API should mostly be used from plugins.
Common use case for using it is to check if all tags were processed and put out appropriate warning when they were not.
<T> TemplateDocument process(T data)
Modifies document according to rules for specified data type. Tags are resolved from properties, fields, methods, column names, etc...
Tags are resolved from properties, fields, methods, column names, etc...
Plugins will be invoked when this API is used, such as formatters, navigations and handlers.
Templater will find the best processor type which will process input data with the appropriate rules.
Process method can be called multiple times if there are multiple root objects.
document.process(resultSet);
document.process(jsonMap);
T
- type of data to processdata
- data for modifying tags. Specific rules will be chosen from its typevoid close()
close
in interface java.lang.AutoCloseable