Package org.apache.velocity.util.introspection

Examples of org.apache.velocity.util.introspection.Info


              // mainly check the number of arguments
                vmProxy.init(rsvc, context, node);
            }
            catch (TemplateInitException die)
            {
                Info info = new Info(sourceTemplate, node.getLine(), node.getColumn());
                throw new ParseErrorException(die.getMessage() + " at "
                    + Log.formatFileString(info), info);
            }

            try
            {
                return vmProxy.render(context, writer, node);
            }
            catch (RuntimeException e)
            {
                /**
                 * We catch, the exception here so that we can record in
                 * the logs the template and line number of the macro call
                 * which generate the exception.  This information is
                 * especially important for multiple macro call levels.
                 * this is also true for the following catch blocks.
                 */
                rsvc.getLog().error("Exception in macro #" + macroName + " at " +
                  Log.formatFileString(sourceTemplate, getLine(), getColumn()));
                throw e;
            }
            catch (IOException e)
            {
                rsvc.getLog().error("Exception in macro #" + macroName + " at " +
                  Log.formatFileString(sourceTemplate, getLine(), getColumn()));
                throw e;
            }
        }
        else if (strictRef)
        {
            Info info = new Info(sourceTemplate, node.getLine(), node.getColumn());
            throw new ParseErrorException("Macro '#" + macroName + "' is not defined at "
                + Log.formatFileString(info), info);
        }
       
        /**
 
View Full Code Here


        /*
         * make an uberinfo - saves new's later on
         */

        uberInfo = new Info(getTemplateName(), getLine(),getColumn());

        /*
         * track whether we log invalid references
         */
        logOnNull =
View Full Code Here

            int expectedLine, int expectedCol) throws Exception
    {
        Context context = new VelocityContext();
        StringWriter writer = new StringWriter();
        Template template = ve.getTemplate(templateName, "UTF-8");
        Info info = null;

        context.put("main", this);

        try
        {
View Full Code Here

    {
        super.init(context, data);

        identifier = getFirstToken().image;

        uberInfo = new Info(getTemplateName(), getLine(), getColumn());

        strictRef = rsvc.getBoolean(RuntimeConstants.RUNTIME_REFERENCES_STRICT, false);
       
        return data;
    }
View Full Code Here

             *  init the tree correctly
             */
   
            super.init( context, data );
   
            uberInfo = new Info(getTemplateName(),
                    getLine(), getColumn());
   
            right = getRightHandSide();
            left = getLeftHandSide();
   
View Full Code Here

        /*
         * make an uberinfo - saves new's later on
         */

        uberInfo = new Info(this.getTemplateName(),
                getLine(),getColumn());
    }
View Full Code Here

            nodeTree = rsvc.parse(sourceText, templateName);
        }
        catch (ParseException pex)
        {
            // use the line/column from the template
            Info info = new Info( templateName, node.getLine(), node.getColumn() );
            throw  new ParseErrorException( pex.getMessage(), info );
        }
        catch (TemplateInitException pex)
        {
            Info info = new Info( templateName, node.getLine(), node.getColumn() );
            throw  new ParseErrorException( pex.getMessage(), info );
        }

        /*
         * now we want to init and render.  Chain the context
         * to prevent any changes to the current context.
         */

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

            ica.pushCurrentTemplateName( templateName );

            try
            {
                try
                {
                    nodeTree.init( ica, rsvc );
                }
                catch (TemplateInitException pex)
                {
                    Info info = new Info( templateName, node.getLine(), node.getColumn() );
                    throw  new ParseErrorException( pex.getMessage(), info );
                }

                try
                {
                    /*
                     *  now render, and let any exceptions fly
                     */
                    nodeTree.render( ica, writer );
                }
                catch (ParseErrorException pex)
                {
                    // convert any parsing errors to the correct line/col
                    Info info = new Info( templateName, node.getLine(), node.getColumn() );
                    throw  new ParseErrorException( pex.getMessage(), info );
                }
            }
            finally
            {
View Full Code Here

        /*
         * make an uberinfo - saves new's later on
         */

        uberInfo = new Info(context.getCurrentTemplateName(),
                getLine(),getColumn());

        return data;
    }
View Full Code Here

                 */

                for (int j = 0; j < paramCount; j++)
                    params[j] = jjtGetChild(j + 1).value(context);

                method = rsvc.getUberspect().getMethod(o, methodName, params, new Info("",1,1));

                if (method != null)
                {   
                    icd = new IntrospectionCacheData();
                    icd.contextData = c;
View Full Code Here

    {
        super.init(context, data);

        identifier = getFirstToken().image;

        uberInfo = new Info(context.getCurrentTemplateName(),
                getLine(), getColumn());

        return data;
    }
View Full Code Here

TOP

Related Classes of org.apache.velocity.util.introspection.Info

Copyright © 2018 www.massapicom. 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.