@OpenApiAll
public interface ITemplateEngine
Modifier and Type | Method and Description |
---|---|
void |
abort()
Called by the application to abort current evaluation context.
|
java.lang.Object |
addContext(java.lang.String name,
java.lang.Object value)
Adds a name/value pair to the context.
|
void |
addInvalidReferenceHandler(IInvalidReferenceHandler handler)
Add an invalid reference event handler to the engine.
|
void |
addReferenceInsertionHandler(IReferenceInsertionHandler handler)
Add a reference insertion event handler to the engine.
|
Template |
createTemplate()
Creates a new and empty
Template for generating report by this engine. |
Template |
createTemplate(java.io.File input,
java.io.File output)
Creates a new
Template object. |
void |
destroy()
Called by the application or
TemplateEngineFactory to inform this engine
that it should destroy any resources that it has allocated. |
void |
evaluate(Template template)
Merge a template with current context and rendered stream into the writer.
|
IContext |
getContext()
Return context of this engine.
|
IFormatter |
getFormatter()
Returns a formatter that can be used to create the object layout, and formats of state
InsertionHandler . |
java.util.List<IInvalidReferenceHandler> |
getInvalidReferenceHandler()
Return a
IInvalidReferenceHandler of this engine. |
java.util.Properties |
getProperties()
Returns the current properties of engine.
|
java.lang.Object |
getProperty(java.lang.String key)
Return an engine Runtime property.
|
java.util.List<IReferenceInsertionHandler> |
getReferenceInsertionHandler()
Return a
IInvalidReferenceHandler of this engine. |
void |
setProperty(java.lang.String key,
java.lang.Object value)
Set an engine Runtime property.
|
Template createTemplate()
Template
for generating report by this engine.Template
createTemplate(File, File)
Template createTemplate(java.io.File input, java.io.File output) throws java.io.IOException
Template
object.input
- template file.output
- output file.Template
java.io.FileNotFoundException
- if the file does not exist, is a directory rather than a regular file,
or for some other reason cannot be opened.java.io.IOException
- If an I/O error occursIFormatter getFormatter()
InsertionHandler
.IContext getContext()
java.lang.Object addContext(java.lang.String name, java.lang.Object value)
name
- The name to key the provided value with.value
- The corresponding value.java.lang.Object getProperty(java.lang.String key)
key
- the property keysetProperty(String, Object)
void setProperty(java.lang.String key, java.lang.Object value)
key
- the key to be placed into this property list.value
- the value corresponding to key.getProperty(String)
java.util.Properties getProperties()
void addReferenceInsertionHandler(IReferenceInsertionHandler handler)
handler
- ReferenceInsertionEventHandlervoid addInvalidReferenceHandler(IInvalidReferenceHandler handler)
handler
- IInvalidReferenceHandlerjava.util.List<IInvalidReferenceHandler> getInvalidReferenceHandler()
IInvalidReferenceHandler
of this engine.java.util.List<IReferenceInsertionHandler> getReferenceInsertionHandler()
IInvalidReferenceHandler
of this engine.void evaluate(Template template) throws TemplateException
template
- Template being evaluatedParseErrorException
- if a syntax or other error which prevents it from being
parsed.InitializationEngineException
- when engine initialize errorTemplateException
- other errorvoid destroy()
TemplateEngineFactory
to inform this engine
that it should destroy any resources that it has allocated.void abort()
Copyright © 2010 - No Magic Asia