Package org.apache.velocity.exception

Examples of org.apache.velocity.exception.ParseErrorException


            ParseErrorException,
            MethodInvocationException {

        String column = getChildAsString(context, node, 0);
        if (column == null) {
            throw new ParseErrorException("Column name expected at line "
                    + node.getLine()
                    + ", column "
                    + node.getColumn());
        }
View Full Code Here


        else if (value != null) {
            jdbcType = TypesMapping.getSqlTypeByJava(value.getClass());
        }

        if (jdbcType == TypesMapping.NOT_DEFINED) {
            throw new ParseErrorException(
                "Can't determine JDBC type of binding ("
                    + value
                    + ", "
                    + type
                    + ") at line "
View Full Code Here

        }
        catch( UnsupportedEncodingException  uce )
        {
            String msg = "Unsupported input encoding : " + encoding
                + " for template " + logTag;
            throw new ParseErrorException( msg );
        }

        return evaluate( context, writer, logTag, br );
    }
View Full Code Here

              // mainly check the number of arguments
                vmProxy.checkArgs(context, node, body != null);
            }
            catch (TemplateInitException die)
            {
                throw new ParseErrorException(die.getMessage() + " at "
                    + Log.formatFileString(node), new Info(node));
            }

            if (badArgsErrorMsg != null)
            {
View Full Code Here

        }
        catch( UnsupportedEncodingException  uce )
        {
            String msg = "Unsupported input encoding : " + encoding
                + " for template " + logTag;
            throw new ParseErrorException( msg );
        }

        return evaluate( context, writer, logTag, br );
    }
View Full Code Here

            catch( UnsupportedEncodingException  uce )
            {
                String msg = "Template.process : Unsupported input encoding : " + encoding
                + " for template " + name;

                errorCondition  = new ParseErrorException( msg );
                throw errorCondition;
            }
            catch ( ParseException pex )
            {
                /*
                 *  remember the error and convert
                 */
                errorCondition =  new ParseErrorException(pex, name);
                throw errorCondition;
            }
            catch ( TemplateInitException pex )
            {
                errorCondition = new ParseErrorException( pex, name);
                throw errorCondition;
            }
            /**
             * pass through runtime exceptions
             */
 
View Full Code Here

        }
        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)
        {
            InternalContextAdapter ica = 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
                {
                    preRender(ica);

                    /*
                     *  now render, and let any exceptions fly
                     */
                    nodeTree.render( ica, writer );
                }
                catch (StopCommand stop)
                {
                    if (!stop.isFor(this))
                    {
                        throw stop;
                    }
                    else if (rsvc.getLog().isDebugEnabled())
                    {
                        rsvc.getLog().debug(stop.getMessage());
                    }
                }
                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
            {
                ica.popCurrentTemplateName();
View Full Code Here

        {
            nodeTree = parse(reader, logTag);
        }
        catch (ParseException pex)
        {
            throw new ParseErrorException(pex, null);
        }
        catch (TemplateInitException pex)
        {
            throw new ParseErrorException(pex, null);
        }

        if (nodeTree == null)
        {
            return false;
View Full Code Here

            {
                nodeTree.init(ica, this);
            }
            catch (TemplateInitException pex)
            {
                throw new ParseErrorException(pex, null);
            }
            /**
             * pass through application level runtime exceptions
             */
            catch(RuntimeException e)
View Full Code Here

        try {
            nodeTree = velocityRuntime.parse(new StringReader(template), template);
        }
        catch (ParseException pex) {
            throw new ParseErrorException(pex.getMessage());
        }

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

TOP

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

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.