Examples of EventCartridge


Examples of org.apache.velocity.app.event.EventCartridge

    }

    private void initializeEventHandlers()
    {

        eventCartridge = new EventCartridge();

        /**
         * For each type of event handler, get the class name, instantiate it, and store it.
         */

 
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge

    {
        Context ctx = new VelocityContext();

        // Attach an Event Cartridge to it, so we get exceptions
        // while invoking methods from the Velocity Screens
        EventCartridge ec = new EventCartridge();
        ec.addEventHandler(this);
        ec.attachToContext(ctx);
        return ctx;
    }
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge

        // initialize thread safe velocity engine cache
        int cacheSize = (int) getLongInitParameter(config, CACHE_SIZE_PARAMETER, DEFAULT_CACHE_SIZE);
        velocityEngineConfigCache = new LRUMap(cacheSize);
        velocityEngineCache = new LRUMap(cacheSize/2);
       
        eventCartridge = new EventCartridge();
        // setup NullSetEventHandler to ignore those pesky "ERROR velocity - RHS of #set statement is null. Context will not be modified."
        eventCartridge.addEventHandler(new NullSetEventHandler()
        {
            public boolean shouldLogOnNullSet(String lhs, String rhs) { return false; }
        });
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge

        // initialize thread safe velocity engine cache
        int cacheSize = (int) getLongInitParameter(config, CACHE_SIZE_PARAMETER, DEFAULT_CACHE_SIZE);
        velocityEngineConfigCache = new LRUMap(cacheSize);
        velocityEngineCache = new LRUMap(cacheSize/2);
       
        eventCartridge = new EventCartridge();
        // setup NullSetEventHandler to ignore those pesky "ERROR velocity - RHS of #set statement is null. Context will not be modified."
        eventCartridge.addEventHandler(new NullSetEventHandler()
        {
            public boolean shouldLogOnNullSet(String lhs, String rhs) { return false; }
        });
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge

    }

    private void initializeEventHandlers()
    {

        eventCartridge = new EventCartridge();

        /**
         * For each type of event handler, get the class name, instantiate it, and store it.
         */

 
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge

         *  Now make an event cartridge, register all the
         *  event handlers (at once) and attach it to the
         *  Context
         */
       
        EventCartridge ec = new EventCartridge();
        ec.addEventHandler(te);
        ec.attachToContext( inner );
       
        doTestInvalidReferenceEventHandler1(ve, inner);
        doTestInvalidReferenceEventHandler2(ve, inner);
        doTestInvalidReferenceEventHandler3(ve, inner);
        doTestInvalidReferenceEventHandler4(ve, inner);
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge

    public void testOverrideNullArgumentForParse()
    {
        String nullContent = "Parse arg was null";
        addTemplate("null.vm", nullContent);
       
        EventCartridge ec = new EventCartridge();
        ec.addEventHandler(new Handler());
        ec.attachToContext(context);

        assertEvalEquals(nullContent, "#parse($foo)");
    }
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge

        Writer writer1 = new BufferedWriter(new OutputStreamWriter(fos1));

        // set up handler
        Context context = new VelocityContext();
        EventCartridge ec = new EventCartridge();
        ec.addEventHandler(this);
        ec.attachToContext( context );

        // BEHAVIOR A: pass through #input and #parse with no change
        EventHandlerBehavior = PASS_THROUGH;

        template1.merge(context, writer1);
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge

        Writer writer2 = new BufferedWriter(new OutputStreamWriter(fos2));

        // set up handler
        Context context = new VelocityContext();
        EventCartridge ec = new EventCartridge();
        ec.addEventHandler(this);
        ec.attachToContext( context );

        // BEHAVIOR B: pass through #input and #parse with using a relative path
        EventHandlerBehavior = RELATIVE_PATH;

        template2.merge(context, writer2);
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge

        Writer writer3 = new BufferedWriter(new OutputStreamWriter(fos3));

        // set up handler
        Context context = new VelocityContext();
        EventCartridge ec = new EventCartridge();
        ec.addEventHandler(this);
        ec.attachToContext( context );

        // BEHAVIOR C: refuse to pass through #input and #parse
        EventHandlerBehavior = BLOCK;

        template3.merge(context, writer3);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.