org.apache.velocity.app.event
public class EventCartridge extends Object implements ReferenceInsertionEventHandler, NullSetEventHandler, MethodExceptionEventHandler
Version: $Id: EventCartridge.java,v 1.3.4.1 2004/03/03 23:22:53 geirm Exp $
Field Summary | |
---|---|
MethodExceptionEventHandler | meeh |
NullSetEventHandler | nseh |
ReferenceInsertionEventHandler | rieh |
Method Summary | |
---|---|
boolean | addEventHandler(EventHandler ev)
Adds an event handler(s) to the Cartridge. |
boolean | attachToContext(Context context)
Attached the EventCartridge to the context
Final because not something one should mess with lightly :)
|
Object | methodException(Class claz, String method, Exception e)
Implementation of MethodExceptionEventHandler method
methodException() .
|
Object | referenceInsert(String reference, Object value)
Implementation of ReferenceInsertionEventHandler method
referenceInsert() .
|
boolean | removeEventHandler(EventHandler ev)
Removes an event handler(s) from the Cartridge. |
boolean | shouldLogOnNullSet(String lhs, String rhs)
Implementation of NullSetEventHandler method
shouldLogOnNullSet() .
|
Parameters: ev object impementing a valid EventHandler-derived interface
Returns: true if a supported interface, false otherwise or if null
Parameters: context context to attach to
Returns: true if successful, false otherwise
methodException()
.
Called during Velocity merge if a reference is null
Parameters: claz Class that is causing the exception method method called that causes the exception e Exception thrown by the method
Returns: Object to return as method result
Throws: exception to be wrapped and propogated to app
referenceInsert()
.
Called during Velocity merge before a reference value will
be inserted into the output stream.
Parameters: reference reference from template about to be inserted value value about to be inserted (after toString() )
Returns: Object on which toString() should be called for output.
Parameters: ev object impementing a valid EventHandler-derived interface
Returns: true if a supported interface, false otherwise or if null
shouldLogOnNullSet()
.
Called during Velocity merge to determine if when
a #set() results in a null assignment, a warning
is logged.
Parameters: reference reference from template about to be inserted
Returns: true if to be logged, false otherwise