Examples of InternalContextAdapterImpl


Examples of org.apache.velocity.context.InternalContextAdapterImpl

         * now we want to init and render
         */

        if (nodeTree != null)
        {
            InternalContextAdapterImpl ica =
                new InternalContextAdapterImpl( context );
           
            ica.pushCurrentTemplateName( logTag );
           
            try
            {
                try
                {
                    nodeTree.init( ica, ri );
                }
                catch( Exception e )
                {
                    ri.error("Velocity.evaluate() : init exception for tag = "
                                  + logTag + " : " + e );
                }
               
                /*
                 *  now render, and let any exceptions fly
                 */

                nodeTree.render( ica, writer );
            }
            finally
            {
                ica.popCurrentTemplateName();
            }
           
            return true;
        }
       
View Full Code Here

Examples of org.apache.velocity.context.InternalContextAdapterImpl

         * now we want to init and render
         */

        if (nodeTree != null)
        {
            InternalContextAdapterImpl ica =
                new InternalContextAdapterImpl( context );

            ica.pushCurrentTemplateName( logTag );

            try
            {
                try
                {
                    nodeTree.init( ica, RuntimeSingleton.getRuntimeServices() );
                }
                catch( Exception e )
                {
                    RuntimeSingleton.error("Velocity.evaluate() : init exception for tag = "
                                  + logTag + " : " + e );
                }

                /*
                 *  now render, and let any exceptions fly
                 */

                nodeTree.render( ica, writer );
            }
            finally
            {
                ica.popCurrentTemplateName();
            }

            return true;
        }

View Full Code Here

Examples of org.apache.velocity.context.InternalContextAdapterImpl

                    /*
                     *  init.  be a good citizen and give it an ICA
                     */

                    InternalContextAdapter ica
                            = new InternalContextAdapterImpl(new VelocityContext());

                    ica.pushCurrentTemplateName("VMProxyArg : "
                            + ParserTreeConstants.jjtNodeName[type]);

                    nodeTree.init(ica, rsvc);
                }
                catch ( Exception e )
View Full Code Here

Examples of org.apache.velocity.context.InternalContextAdapterImpl

    public void testLocalscopePutDoesntLeakButGetDoes()
    {
        VelocityContext base = new VelocityContext();
        base.put("outsideVar", "value1");

        VMContext vm = new VMContext(new InternalContextAdapterImpl(base), this.instance);
        vm.put("newLocalVar", "value2");

        // New variable put doesn't leak
        assertNull(base.get("newLocalVar"));
        assertEquals("value2", vm.get("newLocalVar"));
View Full Code Here

Examples of org.apache.velocity.context.InternalContextAdapterImpl

                  /*
                   *  init.  be a good citizen and give it an ICA
                   */

                  InternalContextAdapter ica
                    = new InternalContextAdapterImpl(new VelocityContext());

                  ica.pushCurrentTemplateName("VMProxyArg : "
                    + ParserTreeConstants.jjtNodeName[type]);

                  nodeTree.init(ica, rsvc);
                    }
                }
View Full Code Here

Examples of org.apache.velocity.context.InternalContextAdapterImpl

         * now we want to init and render
         */

        if (nodeTree != null)
        {
            InternalContextAdapterImpl ica =
                new InternalContextAdapterImpl( context );

            ica.pushCurrentTemplateName( logTag );

            try
            {
                try
                {
                    nodeTree.init( ica, ri );
                }
                catch (TemplateInitException pex)
                {
                    throw  new ParseErrorException( pex );
                }
                /**
                 * pass through application level runtime exceptions
                 */
                catch( RuntimeException e )
                {
                    throw e;
                }
                catch(Exception e)
                {
                    getLog().error("Velocity.evaluate() : init exception for tag = "
                                   + logTag, e);
                }

                /*
                 *  now render, and let any exceptions fly
                 */

                nodeTree.render( ica, writer );
            }
            finally
            {
                ica.popCurrentTemplateName();
            }

            return true;
        }

View Full Code Here

Examples of org.apache.velocity.context.InternalContextAdapterImpl

         * now we want to init and render
         */

        if (nodeTree != null)
        {
            InternalContextAdapterImpl ica =
                new InternalContextAdapterImpl( context );

            ica.pushCurrentTemplateName( logTag );

            try
            {
                try
                {
                    nodeTree.init( ica, RuntimeSingleton.getRuntimeServices() );
                }
                catch (TemplateInitException pex)
                {
                    throw  new ParseErrorException( pex );
                }
                /**
                 * pass through application level runtime exceptions
                 */
                catch( RuntimeException e )
                {
                    throw e;
                }
                catch( Exception e )
                {
                    getLog().error("Velocity.evaluate() : init exception for tag = "+logTag, e);
                }

                /*
                 *  now render, and let any exceptions fly
                 */

                nodeTree.render( ica, writer );
            }
            finally
            {
                ica.popCurrentTemplateName();
            }

            return true;
        }

View Full Code Here

Examples of org.apache.velocity.context.InternalContextAdapterImpl

    {
        /*
         *  send an empty InternalContextAdapter down into the AST to initialize it
         */

        InternalContextAdapterImpl ica = new InternalContextAdapterImplnew VelocityContext() );

        try
        {
            /*
             *  put the current template name on the stack
             */

            ica.pushCurrentTemplateName( name );

            /*
             *  init the AST
             */

            ((SimpleNode)data).init( ica, rsvc);
        }
        finally
        {
            /*
             *  in case something blows up...
             *  pull it off for completeness
             */

            ica.popCurrentTemplateName();
        }

    }
View Full Code Here

Examples of org.apache.velocity.context.InternalContextAdapterImpl

            /*
             *  create an InternalContextAdapter to carry the user Context down
             *  into the rendering engine.  Set the template name and render()
             */

            InternalContextAdapterImpl ica = new InternalContextAdapterImpl( context );

            try
            {
                ica.pushCurrentTemplateName( name );
                ica.setCurrentResource( this );

                ( (SimpleNode) data ).render( ica, writer);
            }
            finally
            {
                /*
                 *  lets make sure that we always clean up the context
                 */
                ica.popCurrentTemplateName();
                ica.setCurrentResource( null );
            }
        }
        else
        {
            /*
 
View Full Code Here

Examples of org.apache.velocity.context.InternalContextAdapterImpl

        if (nodeTree == null) {
            throw new CayenneRuntimeException("Error parsing template " + template);
        }

        // ... not sure what InternalContextAdapter is for...
        InternalContextAdapterImpl ica = new InternalContextAdapterImpl(context);
        ica.pushCurrentTemplateName(template);

        try {
            nodeTree.init(ica, velocityRuntime);
            nodeTree.render(ica, out);
            return out.toString();
        }
        finally {
            ica.popCurrentTemplateName();
        }
    }
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.