@OpenApiAll public class InsertionHandler extends java.lang.Object implements IReferenceInsertionHandler
if (value==null) return reference;
else return IFormatter.format(Object)
;
Please return an Object that will toString() nicely :)Modifier and Type | Field and Description |
---|---|
protected ITemplateEngine |
engine
Reference to template engine.
|
Constructor and Description |
---|
InsertionHandler(ITemplateEngine engine)
Create an handler with
DefaultFormatter . |
Modifier and Type | Method and Description |
---|---|
protected IFormatter |
createFormatter(java.lang.Class<ITemplateEngine> engineClass)
Deprecated.
the formatter is no longer determined by Class
ITemplateEngine . It will be created directly
from ITemplateEngine.getFormatter() . |
java.lang.Object |
referenceInsert(java.lang.String reference,
java.lang.Object value,
java.util.Properties properties)
A call-back which is executed during Velocity merge before a reference value is inserted into the output
stream.
|
protected ITemplateEngine engine
public InsertionHandler(ITemplateEngine engine)
DefaultFormatter
.engine
- owner engineprotected IFormatter createFormatter(java.lang.Class<ITemplateEngine> engineClass)
ITemplateEngine
. It will be created directly
from ITemplateEngine.getFormatter()
.engineClass
- the template enginepublic java.lang.Object referenceInsert(java.lang.String reference, java.lang.Object value, java.util.Properties properties)
referenceInsert
in interface IReferenceInsertionHandler
reference
- Reference from template about to be inserted.value
- Value about to be inserted (after its toString()
method is called).properties
- the engine propertiestoString()
should be called for output.Copyright © 2010 - No Magic Asia