Examples of VelocimacroProxy


Examples of org.apache.velocity.runtime.directive.VelocimacroProxy

            return nodeTree;
        }

        VelocimacroProxy createVelocimacro()
        {
            VelocimacroProxy vp = new VelocimacroProxy();
            vp.setName( this.macroname );
            vp.setArgArraythis.argarray );
            vp.setMacrobody( this.macrobody );
            vp.setNodeTree( this.nodeTree);

            return vp;
        }
View Full Code Here

Examples of org.apache.velocity.runtime.directive.VelocimacroProxy

            return sourcetemplate;
        }

        VelocimacroProxy createVelocimacro(String namespace)
        {
            VelocimacroProxy vp = new VelocimacroProxy();
            vp.setName(this.macroname);
            vp.setArgArray(this.argarray);
            vp.setMacrobody(this.macrobody);
            vp.setNodeTree(this.nodeTree);
            vp.setNamespace(namespace);
            return vp;
        }
View Full Code Here

Examples of org.apache.velocity.runtime.directive.VelocimacroProxy

            return sourcetemplate;
        }

        VelocimacroProxy createVelocimacro(String namespace)
        {
            VelocimacroProxy vp = new VelocimacroProxy();
            vp.setName(this.macroname);
            vp.setArgArray(this.argarray);
            vp.setNodeTree(this.nodeTree);
            vp.setNamespace(namespace);
            return vp;
        }
View Full Code Here

Examples of org.apache.velocity.runtime.directive.VelocimacroProxy

     *  behave correctly wrt getting the framework to
     *  dig out the correct # of args
     */
    public Directive getVelocimacro( String vmName, String sourceTemplate )
    {
        VelocimacroProxy vp = null;

        synchronized( this )
        {
            /*
             *  don't ask - do
View Full Code Here

Examples of org.apache.velocity.runtime.directive.VelocimacroProxy

            this.vmName = vmName;
            this.argArray = argArray;
            this.nodeTree = (SimpleNode)macro;
            this.sourceTemplate = sourceTemplate;

            vp = new VelocimacroProxy();
            vp.setName(this.vmName);
            vp.setArgArray(this.argArray);
            vp.setNodeTree(this.nodeTree);

      }finally{//ζˆ‘εŠ δΈŠηš„
View Full Code Here

Examples of org.apache.velocity.runtime.directive.VelocimacroProxy

    DEBUG.P(this,"getVelocimacro(3)");
    DEBUG.P("vmName="+vmName);
    DEBUG.P("sourceTemplate="+sourceTemplate);
    DEBUG.P("renderingTemplate="+renderingTemplate);

        VelocimacroProxy vp = null;

        vp = vmManager.get(vmName, sourceTemplate, renderingTemplate);

    DEBUG.P("vp="+vp);
    DEBUG.P("autoReloadLibrary="+autoReloadLibrary);
View Full Code Here

Examples of org.apache.velocity.runtime.directive.VelocimacroProxy

            this.vmName = vmName;
            this.argArray = argArray;
            this.nodeTree = (SimpleNode)macro;
            this.sourceTemplate = sourceTemplate;

            vp = new VelocimacroProxy();
            vp.setName(this.vmName);
            vp.setArgArray(this.argArray);
            vp.setNodeTree(this.nodeTree);
        }
View Full Code Here

Examples of org.apache.velocity.runtime.directive.VelocimacroProxy

     /**
      * @since 1.6
      */
     public Directive getVelocimacro(String vmName, String sourceTemplate, String renderingTemplate)
     {
        VelocimacroProxy vp = null;

        vp = vmManager.get(vmName, sourceTemplate, renderingTemplate);

        /*
         * if this exists, and autoload is on, we need to check where this VM came from
View Full Code Here

Examples of org.apache.velocity.runtime.directive.VelocimacroProxy

        /*
         * apparently.  Ok, make one..
         */
          
        VelocimacroProxy vp =
            (VelocimacroProxy) Runtime.getVelocimacro( vmName, namespace );
       
        if ( vp == null )
        {
            Runtime.error( "Velocity.invokeVelocimacro() : VM '"
                           + vmName
                           + "' : severe error.  Unable to get VM from factory.");
            return false;
        }
 
        /*
         * if we get enough args?
         */
           
        if ( vp.getNumArgs() > params.length )
        {
            Runtime.error( "Velocity.invokeVelocimacro() : VM '"
                           + vmName + "' : invalid # of args.  Needed "
                           + vp.getNumArgs()
                           + " but called with " + params.length);
            return false;
        }

        /*
         *  ok.  setup the vm
         */

        /*
         *  fix the parms : since we don't require the $ from the caller,
         *  we need to add it
         */

        int [] types = new int[vp.getNumArgs()];
        String[] p = new String[vp.getNumArgs()];
        for( int i = 0; i < types.length; i++)
        {
            types[i] = ParserTreeConstants.JJTREFERENCE;
            p[i] = "$" + params[i];
        }

        vp.setupMacro( p, types  );
     
        try
        {
            InternalContextAdapterImpl ica
                = new InternalContextAdapterImpl( context );
           
            try
            {
                ica.pushCurrentTemplateName( namespace );
                vp.render( ica, writer, null);
            }
            finally
            {
                ica.popCurrentTemplateName();
            }
View Full Code Here

Examples of org.apache.velocity.runtime.directive.VelocimacroProxy

     *  behave correctly wrt getting the framework to
     *  dig out the correct # of args
     */
    public Directive getVelocimacro( String vmName, String sourceTemplate )
    {
        VelocimacroProxy vp = null;

        synchronized( this )
        {
            /*
             *  don't ask - do
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.