Package org.apache.velocity.exception

Examples of org.apache.velocity.exception.TemplateInitException


                    + VelocityException.formatFileString(node), new Info(node));
            }

            if (badArgsErrorMsg != null)
            {
                throw new TemplateInitException(badArgsErrorMsg,
                  context.getCurrentTemplateName(), node.getColumn(), node.getLine());
            }

            try
            {
View Full Code Here


            if (strictArguments)
            {
                /**
                 * indicate col/line assuming it starts at 0 - this will be corrected one call up
                 */
                throw new TemplateInitException(buildErrorMsg(node, i),
                    context.getCurrentTemplateName(), 0, 0);
            }
            else if (Logger.isDebugEnabled(this.getClass()))
            {
                Logger.debug(this,buildErrorMsg(node, i));
View Full Code Here

                    {
                        directive.init( rsvc, context, this );
                    }
                    catch (TemplateInitException die)
                    {
                        throw new TemplateInitException(die.getMessage(),
                            (ParseException) die.getWrappedThrowable(),
                            die.getTemplateName(),
                            die.getColumnNumber() + getColumn(),
                            die.getLineNumber() + getLine());
                    }
                    isDirective = true;
                }
                else
                {
                    // this is a fake block macro call without a body. e.g. #@foo
                    // just render as it is
                    isDirective = false;
                }
            }
            else
            {
                /**
                 * Create a new RuntimeMacro
                 */
                directive = new RuntimeMacro(directiveName);
                directive.setLocation(getLine(), getColumn(), getTemplateName());
       
                /**
                 * Initialize it
                 */
                try
                {
                    directive.init( rsvc, context, this );
                }
   
                /**
                 * correct the line/column number if an exception is caught
                 */
                catch (TemplateInitException die)
                {
                    throw new TemplateInitException(die.getMessage(),
                            (ParseException) die.getWrappedThrowable(),
                            die.getTemplateName(),
                            die.getColumnNumber() + getColumn(),
                            die.getLineNumber() + getLine());
                }
View Full Code Here

            }
            catch (ParseException e)
            {
                String msg = "Failed to parse String literal at "+
                        VelocityException.formatFileString(templateName, getLine(), getColumn());
                throw new TemplateInitException(msg, e, templateName, getColumn(), getLine());
            }

            adjTokenLineNums(nodeTree);
           
            /*
 
View Full Code Here

TOP

Related Classes of org.apache.velocity.exception.TemplateInitException

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.