Package org.apache.velocity.exception

Examples of org.apache.velocity.exception.ParseErrorException


        expect(generator.getDirectoryName(directory, packageName, suite, parameters)).andReturn("mydir");
        File mydir = new File(directory, "mydir");
        expect(generator.getFilename(mydir , packageName, suite, parameters)).andReturn("myfile.txt");
        String sampleVmPath = "/sample.vm";
        expect(generator.getTemplatePath(mydir, packageName, suite, parameters)).andReturn(sampleVmPath);
        expect(velocityEngine.getTemplate("/sample.vm")).andThrow(new ParseErrorException("hello"));

        replay(velocityEngine, generator, suite, template, parameters);
        generator.generate(directory, packageName, suite, parameters);
        verify(velocityEngine, generator, suite, template, parameters);
    }
View Full Code Here


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

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

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

        expect(generator.getDirectoryName(directory, packageName, suite, clazz, parameters, runtimeClass, requestClass)).andReturn("mydir");
        File mydir = new File(directory, "mydir");
        expect(generator.getFilename(mydir , packageName, suite, clazz, parameters, runtimeClass, requestClass)).andReturn("myfile.txt");
        String sampleVmPath = "/sample.vm";
        expect(generator.getTemplatePath(mydir, packageName, suite, clazz, parameters, runtimeClass, requestClass)).andReturn(sampleVmPath);
        expect(velocityEngine.getTemplate("/sample.vm")).andThrow(new ParseErrorException("hello"));

        replay(velocityEngine, generator, suite, clazz, template, parameters);
        generator.generate(directory, packageName, suite, clazz, parameters, runtimeClass, requestClass);
        verify(velocityEngine, generator, suite, clazz, template, parameters);
    }
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

        {
            nodeTree = ri.parse( reader, logTag );       
        }
        catch ( ParseException pex )
        {
            throw  new ParseErrorException( pex.getMessage() );
        }               
    
        /*
         * now we want to init and render
         */
 
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

        {
            nodeTree = RuntimeSingleton.parse( reader, logTag );       
        }
        catch ( ParseException pex )
        {
            throw  new ParseErrorException( pex.getMessage() );
        }               
    
        /*
         * now we want to init and render
         */
 
View Full Code Here

            throws IOException, ResourceNotFoundException, 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

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

        if (nodeTree == null)
        {
            return false;
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.