net.sourceforge.rtf.template.velocity
Class VelocityTemplateEngineImpl.InsertionHandler

java.lang.Object
  extended by net.sourceforge.rtf.template.velocity.VelocityTemplateEngineImpl.InsertionHandler
All Implemented Interfaces:
org.apache.velocity.app.event.EventHandler, org.apache.velocity.app.event.ReferenceInsertionEventHandler
Enclosing class:
VelocityTemplateEngineImpl

protected class VelocityTemplateEngineImpl.InsertionHandler
extends java.lang.Object
implements org.apache.velocity.app.event.ReferenceInsertionEventHandler

The handler for insertion of references. It applies default formatting - if set with AbstractTemplateEngine.setDefaultFormat(Class, Format) - to values according to their class.
null values are replaced with an empty string. This prevents keys to show up in the result of the merge if a method of a business object in the context returns null - in this case velocity complains about an invalid references :(.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.velocity.app.event.ReferenceInsertionEventHandler
org.apache.velocity.app.event.ReferenceInsertionEventHandler.referenceInsertExecutor
 
Constructor Summary
protected VelocityTemplateEngineImpl.InsertionHandler()
           
 
Method Summary
 java.lang.Object referenceInsert(java.lang.String reference, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VelocityTemplateEngineImpl.InsertionHandler

protected VelocityTemplateEngineImpl.InsertionHandler()
Method Detail

referenceInsert

public java.lang.Object referenceInsert(java.lang.String reference,
                                        java.lang.Object value)
Specified by:
referenceInsert in interface org.apache.velocity.app.event.ReferenceInsertionEventHandler


Copyright 2007 null. All Rights Reserved.