Package io.github.erdos.stencil
Class API
java.lang.Object
io.github.erdos.stencil.API
- 
Method SummaryModifier and TypeMethodDescriptionstatic PreparedFragmentstatic PreparedFragmentfragment(File fragmentFile, PrepareOptions options) Prepares a document fragment from the file system.static PreparedTemplatePrepares a document template file from the file system.static PreparedTemplateprepare(File templateFile, PrepareOptions options) Prepares a document template file from the file system.static EvaluatedDocumentrender(PreparedTemplate template, TemplateData data) static EvaluatedDocumentrender(PreparedTemplate template, Map<String, PreparedFragment> fragments, TemplateData data) static EvaluatedDocumentrender(PreparedTemplate template, Map<String, PreparedFragment> fragments, TemplateData data, Collection<Function> customFunctions) 
- 
Method Details- 
preparePrepares a document template file from the file system.- Throws:
- IOException
 
- 
preparepublic static PreparedTemplate prepare(File templateFile, PrepareOptions options) throws IOException Prepares a document template file from the file system.- Throws:
- IOException
 
- 
fragmentpublic static PreparedFragment fragment(File fragmentFile, PrepareOptions options) throws IOException Prepares a document fragment from the file system. Fragments can be used to embed extra content when rendering document templates. For example, custom headers and footers can be reused across documents this way.- Parameters:
- fragmentFile- template file from file system to be used as document fragment
- Returns:
- fragment instance, not null
- Throws:
- IllegalArgumentException- when fragmentFile is null
- IOException- on file system error
- FileNotFoundException- when file is not found on file system
 
- 
fragment- Throws:
- IOException
 
- 
render
- 
renderpublic static EvaluatedDocument render(PreparedTemplate template, Map<String, PreparedFragment> fragments, TemplateData data) 
- 
renderpublic static EvaluatedDocument render(PreparedTemplate template, Map<String, PreparedFragment> fragments, TemplateData data, Collection<Function> customFunctions) 
 
-