Class AbstractTemplateEngine
java.lang.Object
fr.opensagres.xdocreport.template.AbstractTemplateEngine
- All Implemented Interfaces:
ITemplateEngine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidextractFields(fr.opensagres.xdocreport.core.io.IEntryReaderProvider readerProvider, String entryName, FieldsExtractor extractor) protected booleanisUseTemplateCache(String reportId) voidMerge Java model coming from the given context with the given reader and register the merge result in the given writer.voidprocess(String reportId, String entryName, fr.opensagres.xdocreport.core.io.IEntryReaderProvider readerProvider, fr.opensagres.xdocreport.core.io.IEntryWriterProvider writerProvider, IContext context) Merge Java model coming from the given context with the XML file entryName of the given document archive and modify the entry of the document archive.voidprocess(String reportId, String entryName, fr.opensagres.xdocreport.core.io.IEntryReaderProvider readerProvider, Writer writer, IContext context) protected abstract voidprocessNoCache(String templateName, IContext context, Reader reader, Writer writer) Merge the given template with the given context and writes the result in the given writer.protected abstract voidprocessWithCache(String templateName, IContext context, Writer writer) Merge the given template with the given context and writes the result in the given writer.voidsetConfiguration(ITemplateEngineConfiguration configuration) voidsetTemplateCacheInfoProvider(ITemplateCacheInfoProvider templateCacheInfoProvider) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface fr.opensagres.xdocreport.template.ITemplateEngine
createContext, createContext, extractFields, getDocumentFormatter, getId, getKind, isFieldNameStartsWithUpperCase, process
-
Constructor Details
-
AbstractTemplateEngine
public AbstractTemplateEngine()
-
-
Method Details
-
getTemplateCacheInfoProvider
- Specified by:
getTemplateCacheInfoProviderin interfaceITemplateEngine
-
setTemplateCacheInfoProvider
- Specified by:
setTemplateCacheInfoProviderin interfaceITemplateEngine
-
getConfiguration
- Specified by:
getConfigurationin interfaceITemplateEngine
-
setConfiguration
- Specified by:
setConfigurationin interfaceITemplateEngine
-
process
public void process(String reportId, String entryName, fr.opensagres.xdocreport.core.io.IEntryReaderProvider readerProvider, fr.opensagres.xdocreport.core.io.IEntryWriterProvider writerProvider, IContext context) throws fr.opensagres.xdocreport.core.XDocReportException, IOException Description copied from interface:ITemplateEngineMerge Java model coming from the given context with the XML file entryName of the given document archive and modify the entry of the document archive.- Specified by:
processin interfaceITemplateEngine- Parameters:
reportId-IXDocReport#getId().entryName- entry name of the XML file from the document archive which must be merged. This XML file is the template.readerProvider- entry reader provider.context- Java model context- Throws:
fr.opensagres.xdocreport.core.XDocReportExceptionIOException
-
process
public void process(String reportId, String entryName, fr.opensagres.xdocreport.core.io.IEntryReaderProvider readerProvider, Writer writer, IContext context) throws fr.opensagres.xdocreport.core.XDocReportException, IOException - Specified by:
processin interfaceITemplateEngine- Throws:
fr.opensagres.xdocreport.core.XDocReportExceptionIOException
-
process
public void process(String entryName, IContext context, Reader reader, Writer writer) throws fr.opensagres.xdocreport.core.XDocReportException, IOException Description copied from interface:ITemplateEngineMerge Java model coming from the given context with the given reader and register the merge result in the given writer.- Specified by:
processin interfaceITemplateEngine- Parameters:
entryName- template namecontext- Java model contextreader- template reader to mergewriter- merge result writer- Throws:
fr.opensagres.xdocreport.core.XDocReportExceptionIOException
-
extractFields
public void extractFields(fr.opensagres.xdocreport.core.io.IEntryReaderProvider readerProvider, String entryName, FieldsExtractor extractor) throws fr.opensagres.xdocreport.core.XDocReportException - Specified by:
extractFieldsin interfaceITemplateEngine- Throws:
fr.opensagres.xdocreport.core.XDocReportException
-
isUseTemplateCache
-
processWithCache
protected abstract void processWithCache(String templateName, IContext context, Writer writer) throws fr.opensagres.xdocreport.core.XDocReportException, IOException Merge the given template with the given context and writes the result in the given writer. Cache is used here to avoid parsing the template name each time.- Parameters:
templateName- the template name.context- the context.writer- the result of merge.- Throws:
fr.opensagres.xdocreport.core.XDocReportExceptionIOException
-
processNoCache
protected abstract void processNoCache(String templateName, IContext context, Reader reader, Writer writer) throws fr.opensagres.xdocreport.core.XDocReportException, IOException Merge the given template with the given context and writes the result in the given writer.- Parameters:
templateName- the template name.context- the context.writer- the result of merge.- Throws:
fr.opensagres.xdocreport.core.XDocReportExceptionIOException
-