bboss.org.apache.velocity.app.event.EventCartridge

Here are the examples of the java api class bboss.org.apache.velocity.app.event.EventCartridge taken from open source projects.

1. RuntimeInstance#initializeEventHandlers()

Project: bboss
File: RuntimeInstance.java
private void initializeEventHandlers() {
    eventCartridge = new EventCartridge();
    /**
         * For each type of event handler, get the class name, instantiate it, and store it.
         */
    String[] referenceinsertion = configuration.getStringArray(RuntimeConstants.EVENTHANDLER_REFERENCEINSERTION);
    if (referenceinsertion != null) {
        for (int i = 0; i < referenceinsertion.length; i++) {
            EventHandler ev = initializeSpecificEventHandler(referenceinsertion[i], RuntimeConstants.EVENTHANDLER_REFERENCEINSERTION, ReferenceInsertionEventHandler.class);
            if (ev != null)
                eventCartridge.addReferenceInsertionEventHandler((ReferenceInsertionEventHandler) ev);
        }
    }
    String[] nullset = configuration.getStringArray(RuntimeConstants.EVENTHANDLER_NULLSET);
    if (nullset != null) {
        for (int i = 0; i < nullset.length; i++) {
            EventHandler ev = initializeSpecificEventHandler(nullset[i], RuntimeConstants.EVENTHANDLER_NULLSET, NullSetEventHandler.class);
            if (ev != null)
                eventCartridge.addNullSetEventHandler((NullSetEventHandler) ev);
        }
    }
    String[] methodexception = configuration.getStringArray(RuntimeConstants.EVENTHANDLER_METHODEXCEPTION);
    if (methodexception != null) {
        for (int i = 0; i < methodexception.length; i++) {
            EventHandler ev = initializeSpecificEventHandler(methodexception[i], RuntimeConstants.EVENTHANDLER_METHODEXCEPTION, MethodExceptionEventHandler.class);
            if (ev != null)
                eventCartridge.addMethodExceptionHandler((MethodExceptionEventHandler) ev);
        }
    }
    String[] includeHandler = configuration.getStringArray(RuntimeConstants.EVENTHANDLER_INCLUDE);
    if (includeHandler != null) {
        for (int i = 0; i < includeHandler.length; i++) {
            EventHandler ev = initializeSpecificEventHandler(includeHandler[i], RuntimeConstants.EVENTHANDLER_INCLUDE, IncludeEventHandler.class);
            if (ev != null)
                eventCartridge.addIncludeEventHandler((IncludeEventHandler) ev);
        }
    }
    String[] invalidReferenceSet = configuration.getStringArray(RuntimeConstants.EVENTHANDLER_INVALIDREFERENCES);
    if (invalidReferenceSet != null) {
        for (int i = 0; i < invalidReferenceSet.length; i++) {
            EventHandler ev = initializeSpecificEventHandler(invalidReferenceSet[i], RuntimeConstants.EVENTHANDLER_INVALIDREFERENCES, InvalidReferenceEventHandler.class);
            if (ev != null) {
                eventCartridge.addInvalidReferenceEventHandler((InvalidReferenceEventHandler) ev);
            }
        }
    }
}

2. InternalContextBase#attachEventCartridge()

Project: bboss
File: InternalContextBase.java
/**
     * @see bboss.org.apache.velocity.context.InternalEventContext#attachEventCartridge(bboss.org.apache.velocity.app.event.EventCartridge)
     */
public EventCartridge attachEventCartridge(EventCartridge ec) {
    EventCartridge temp = eventCartridge;
    eventCartridge = ec;
    return temp;
}