public class EventCartridge extends java.lang.Object implements ReferenceInsertionEventHandler, NullSetEventHandler, MethodExceptionEventHandler
Modifier and Type | Field and Description |
---|---|
private MethodExceptionEventHandler |
meeh |
private NullSetEventHandler |
nseh |
private ReferenceInsertionEventHandler |
rieh |
Constructor and Description |
---|
EventCartridge() |
Modifier and Type | Method and Description |
---|---|
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 :)
|
java.lang.Object |
methodException(java.lang.Class claz,
java.lang.String method,
java.lang.Exception e)
Implementation of MethodExceptionEventHandler method
methodException() . |
java.lang.Object |
referenceInsert(java.lang.String reference,
java.lang.Object value)
Implementation of ReferenceInsertionEventHandler method
referenceInsert() . |
boolean |
removeEventHandler(EventHandler ev)
Removes an event handler(s) from the Cartridge.
|
boolean |
shouldLogOnNullSet(java.lang.String lhs,
java.lang.String rhs)
Implementation of NullSetEventHandler method
shouldLogOnNullSet() . |
private ReferenceInsertionEventHandler rieh
private NullSetEventHandler nseh
private MethodExceptionEventHandler meeh
public boolean addEventHandler(EventHandler ev)
ev
- object impementing a valid EventHandler-derived interfacepublic boolean removeEventHandler(EventHandler ev)
ev
- object impementing a valid EventHandler-derived interfacepublic java.lang.Object referenceInsert(java.lang.String reference, java.lang.Object value)
referenceInsert()
.
Called during Velocity merge before a reference value will
be inserted into the output stream.referenceInsert
in interface ReferenceInsertionEventHandler
reference
- reference from template about to be insertedvalue
- value about to be inserted (after toString() )public boolean shouldLogOnNullSet(java.lang.String lhs, java.lang.String rhs)
shouldLogOnNullSet()
.
Called during Velocity merge to determine if when
a #set() results in a null assignment, a warning
is logged.shouldLogOnNullSet
in interface NullSetEventHandler
reference
- reference from template about to be insertedpublic java.lang.Object methodException(java.lang.Class claz, java.lang.String method, java.lang.Exception e) throws java.lang.Exception
methodException()
.
Called during Velocity merge if a reference is nullmethodException
in interface MethodExceptionEventHandler
claz
- Class that is causing the exceptionmethod
- method called that causes the exceptione
- Exception thrown by the methodexception
- to be wrapped and propogated to appjava.lang.Exception
public final boolean attachToContext(Context context)
context
- context to attach toCopyright ? 2002 Apache Software Foundation. All Rights Reserved.