|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.velocity.app.event.EventCartridge
public class EventCartridge
Stores the event handlers. Event handlers can be assigned on a per VelocityEngine instance basis by specifying the class names in the velocity.properties file. Event handlers may also be assigned on a per-page basis by creating a new instance of EventCartridge, adding the event handlers, and then calling attachToContext. For clarity, it's recommended that one approach or the other be followed, as the second method is primarily presented for backwards compatibility.
Note that Event Handlers follow a filter pattern, with multiple event handlers allowed for each event. When the appropriate event occurs, all the appropriate event handlers are called in the sequence they were added to the Event Cartridge. See the javadocs of the specific event handler interfaces for more details.
Constructor Summary | |
---|---|
EventCartridge()
|
Method Summary | |
---|---|
boolean |
addEventHandler(EventHandler ev)
Adds an event handler(s) to the Cartridge. |
void |
addIncludeEventHandler(IncludeEventHandler ev)
Add an include event handler to the Cartridge. |
void |
addInvalidReferenceEventHandler(InvalidReferenceEventHandler ev)
Add an invalid reference event handler to the Cartridge. |
void |
addMethodExceptionHandler(MethodExceptionEventHandler ev)
Add a method exception event handler to the Cartridge. |
void |
addNullSetEventHandler(NullSetEventHandler ev)
Add a null set event handler to the Cartridge. |
void |
addReferenceInsertionEventHandler(ReferenceInsertionEventHandler ev)
Add a reference insertion event handler to the Cartridge. |
boolean |
attachToContext(Context context)
Attached the EventCartridge to the context Final because not something one should mess with lightly :) |
Iterator |
getIncludeEventHandlers()
Iterate through all the stored IncludeEventHandlers objects |
Iterator |
getInvalidReferenceEventHandlers()
Iterate through all the stored InvalidReferenceEventHandlers objects |
Iterator |
getMethodExceptionEventHandlers()
Iterate through all the stored MethodExceptionEventHandler objects |
Iterator |
getNullSetEventHandlers()
Iterate through all the stored NullSetEventHandler objects |
Iterator |
getReferenceInsertionEventHandlers()
Iterate through all the stored ReferenceInsertionEventHandler objects |
void |
initialize(RuntimeServices rs)
Initialize the handlers. |
boolean |
removeEventHandler(EventHandler ev)
Removes an event handler(s) from the Cartridge. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventCartridge()
Method Detail |
---|
public boolean addEventHandler(EventHandler ev)
ev
- object impementing a valid EventHandler-derived interface
public void addReferenceInsertionEventHandler(ReferenceInsertionEventHandler ev)
ev
- ReferenceInsertionEventHandlerpublic void addNullSetEventHandler(NullSetEventHandler ev)
ev
- NullSetEventHandlerpublic void addMethodExceptionHandler(MethodExceptionEventHandler ev)
ev
- MethodExceptionEventHandlerpublic void addIncludeEventHandler(IncludeEventHandler ev)
ev
- IncludeEventHandlerpublic void addInvalidReferenceEventHandler(InvalidReferenceEventHandler ev)
ev
- InvalidReferenceEventHandlerpublic boolean removeEventHandler(EventHandler ev)
ev
- object impementing a valid EventHandler-derived interface
public Iterator getReferenceInsertionEventHandlers()
public Iterator getNullSetEventHandlers()
public Iterator getMethodExceptionEventHandlers()
public Iterator getIncludeEventHandlers()
public Iterator getInvalidReferenceEventHandlers()
public final boolean attachToContext(Context context)
context
- context to attach to
public void initialize(RuntimeServices rs) throws Exception
rs
-
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |