public interface DocumentFactory
Modifier and Type | Interface and Description |
---|---|
static interface |
DocumentFactory.CancellationToken
Cancel Templater processing.
|
Modifier and Type | Method and Description |
---|---|
default TemplateDocument |
open(java.io.InputStream input,
java.lang.String extension,
java.io.OutputStream output)
Opens a document from the specified stream.
|
TemplateDocument |
open(java.io.InputStream input,
java.lang.String extension,
java.io.OutputStream output,
DocumentFactory.CancellationToken cancellationToken)
Opens a document from the specified stream.
|
TemplateDocument |
open(java.lang.String path)
Templater will recognize the appropriate document format from the file extension.
|
TemplateDocument open(java.lang.String path) throws java.io.IOException
path
- path to template document file.
This file will be overwritten with the processed document.java.io.IOException
- unable to read from specified fileTemplateDocument open(java.io.InputStream input, java.lang.String extension, java.io.OutputStream output, DocumentFactory.CancellationToken cancellationToken) throws java.io.IOException
Opens a document from the specified stream. The extension string indicates the type of document in the stream.
Provided cancellation token can be used to stop processing
input
- InputStream
containing the template documentextension
- type of document in input streamoutput
- OutputStream
will be used to output the processed documentcancellationToken
- DocumentFactory.CancellationToken
processing can be cancelled by calling cancel() on the provided tokenjava.io.IOException
- unable to read from streamdefault TemplateDocument open(java.io.InputStream input, java.lang.String extension, java.io.OutputStream output) throws java.io.IOException
Opens a document from the specified stream. The extension string indicates the type of document in the stream.
It will use cancellation token for the current thread
input
- InputStream
containing the template documentextension
- type of document in input streamoutput
- OutputStream
will be used to output the processed documentjava.io.IOException
- unable to read from stream