public interface ITemplateDocument
Represents abstraction over specific document type (text, Word document, ...) All such documents are processed with this same API which allows for code reuse across different templates.
Modifier and Type | Method and Description |
---|---|
java.io.OutputStream |
flush()
Flushes current changes to output stream and finishes processing.
|
<T> ITemplateDocument |
process(T data)
Modifies document according to rules for specified data type.
|
ITemplater |
templater()
Provides access to the low-level API.
|
ITemplater templater()
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> ITemplateDocument process(T data)
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 typejava.io.OutputStream flush()
IDocumentFactory.open
then this will return the original output stream.