Class InsertionHandler
java.lang.Object
com.nomagic.magicreport.engine.velocity.InsertionHandler
- All Implemented Interfaces:
IReferenceInsertionHandler
Reference 'Stream insertion' event handler. Called with object that will be inserted into stream by following
this logic:
if (value==null) return reference;
else return IFormatter.format(Object);
Please return an Object that will toString() nicely :)- Since:
- Jun 19, 2007
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInsertionHandler(ITemplateEngine engine) Create an handler withDefaultFormatter. -
Method Summary
Modifier and TypeMethodDescriptionprotected IFormattercreateFormatter(Class<ITemplateEngine> engineClass) Deprecated.referenceInsert(String reference, Object value, Properties properties) A call-back which is executed during Velocity merge before a reference value is inserted into the output stream.
-
Field Details
-
engine
Reference to template engine.
-
-
Constructor Details
-
InsertionHandler
Create an handler withDefaultFormatter.- Parameters:
engine- owner engine
-
-
Method Details
-
createFormatter
Deprecated.the formatter is no longer determined by ClassITemplateEngine. It will be created directly fromITemplateEngine.getFormatter().Determine and create the formatter base on template engine.- Parameters:
engineClass- the template engine- Returns:
- the formatter
-
referenceInsert
A call-back which is executed during Velocity merge before a reference value is inserted into the output stream. All registered ReferenceInsertionEventHandlers are called in sequence. If no ReferenceInsertionEventHandlers are are registered then reference value is inserted into the output stream as is.- Specified by:
referenceInsertin interfaceIReferenceInsertionHandler- Parameters:
reference- Reference from template about to be inserted.value- Value about to be inserted (after itstoString()method is called).properties- the engine properties- Returns:
- Object on which
toString()should be called for output.
-
ITemplateEngine.