velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject cvs commit: jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node ASTBlock.java ASTDirective.java ASTElseIfStatement.java ASTIfStatement.java Node.java SimpleNode.java
Date Fri, 07 Sep 2001 05:02:16 GMT
geirm       01/09/06 22:02:16

  Modified:    src/java/org/apache/velocity/runtime/parser/node
                        ASTBlock.java ASTDirective.java
                        ASTElseIfStatement.java ASTIfStatement.java
                        Node.java SimpleNode.java
  Log:
  Support for full exception propagation from #parsed templates, so that a
  ResourceNotFoundException or ParseErrorException is propagated to
  the application level.
  
  Revision  Changes    Path
  1.5       +6 -1      jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTBlock.java
  
  Index: ASTBlock.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTBlock.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ASTBlock.java	2001/03/19 17:17:44	1.4
  +++ ASTBlock.java	2001/09/07 05:02:15	1.5
  @@ -60,7 +60,11 @@
   
   import org.apache.velocity.context.InternalContextAdapter;
   import org.apache.velocity.runtime.parser.Parser;
  +
   import org.apache.velocity.exception.MethodInvocationException;
  +import org.apache.velocity.exception.ParseErrorException;
  +import org.apache.velocity.exception.ResourceNotFoundException;
  +
   
   public class ASTBlock extends SimpleNode
   {
  @@ -81,7 +85,8 @@
       }
   
       public boolean render( InternalContextAdapter context, Writer writer)
  -        throws IOException, MethodInvocationException
  +        throws IOException, MethodInvocationException,
  +        	ResourceNotFoundException, ParseErrorException
       {
           int i, k = jjtGetNumChildren();
   
  
  
  
  1.19      +4 -2      jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTDirective.java
  
  Index: ASTDirective.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTDirective.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- ASTDirective.java	2001/08/07 21:56:30	1.18
  +++ ASTDirective.java	2001/09/07 05:02:15	1.19
  @@ -63,6 +63,8 @@
   import org.apache.velocity.runtime.parser.Parser;
   
   import org.apache.velocity.exception.MethodInvocationException;
  +import org.apache.velocity.exception.ParseErrorException;
  +import org.apache.velocity.exception.ResourceNotFoundException;
   
   /**
    * This class is responsible for handling the pluggable
  @@ -74,7 +76,7 @@
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
    * @author <a href="mailto:kav@kav.dk">Kasper Nielsen</a>
  - * @version $Id: ASTDirective.java,v 1.18 2001/08/07 21:56:30 geirm Exp $ 
  + * @version $Id: ASTDirective.java,v 1.19 2001/09/07 05:02:15 geirm Exp $ 
    */
   public class ASTDirective extends SimpleNode
   {
  @@ -140,7 +142,7 @@
       }
   
       public boolean render( InternalContextAdapter context, Writer writer)
  -        throws IOException,MethodInvocationException
  +        throws IOException,MethodInvocationException, ResourceNotFoundException, ParseErrorException
       {
           /*
            *  normal processing
  
  
  
  1.8       +6 -2      jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTElseIfStatement.java
  
  Index: ASTElseIfStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTElseIfStatement.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ASTElseIfStatement.java	2001/03/19 17:17:46	1.7
  +++ ASTElseIfStatement.java	2001/09/07 05:02:15	1.8
  @@ -61,7 +61,10 @@
   
   import org.apache.velocity.context.InternalContextAdapter;
   import org.apache.velocity.runtime.parser.*;
  +
   import org.apache.velocity.exception.MethodInvocationException;
  +import org.apache.velocity.exception.ParseErrorException;
  +import org.apache.velocity.exception.ResourceNotFoundException;
   
   /**
    * This class is responsible for handling the ElseIf VTL control statement.
  @@ -71,7 +74,7 @@
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
  - * @version $Id: ASTElseIfStatement.java,v 1.7 2001/03/19 17:17:46 geirm Exp $ 
  + * @version $Id: ASTElseIfStatement.java,v 1.8 2001/09/07 05:02:15 geirm Exp $ 
   */
   public class ASTElseIfStatement extends SimpleNode
   {
  @@ -109,7 +112,8 @@
        *  renders the block
        */
       public boolean render( InternalContextAdapter context, Writer writer)
  -        throws IOException,MethodInvocationException
  +        throws IOException,MethodInvocationException, 
  +        	ResourceNotFoundException, ParseErrorException
       {
           return jjtGetChild(1).render( context, writer );
       }
  
  
  
  1.8       +7 -2      jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTIfStatement.java
  
  Index: ASTIfStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTIfStatement.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ASTIfStatement.java	2001/03/19 17:17:48	1.7
  +++ ASTIfStatement.java	2001/09/07 05:02:15	1.8
  @@ -62,7 +62,7 @@
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
  - * @version $Id: ASTIfStatement.java,v 1.7 2001/03/19 17:17:48 geirm Exp $ 
  + * @version $Id: ASTIfStatement.java,v 1.8 2001/09/07 05:02:15 geirm Exp $ 
   */
   
   
  @@ -71,7 +71,11 @@
   
   import org.apache.velocity.context.InternalContextAdapter;
   import org.apache.velocity.runtime.parser.*;
  +
   import org.apache.velocity.exception.MethodInvocationException;
  +import org.apache.velocity.exception.ParseErrorException;
  +import org.apache.velocity.exception.ResourceNotFoundException;
  +
   
   public class ASTIfStatement extends SimpleNode
   {    
  @@ -92,7 +96,8 @@
       }
       
       public boolean render( InternalContextAdapter context, Writer writer)
  -        throws IOException,MethodInvocationException
  +        throws IOException,MethodInvocationException,
  +        	ResourceNotFoundException, ParseErrorException
       {
           /*
            * Check if the #if(expression) construct evaluates to true:
  
  
  
  1.7       +3 -1      jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/Node.java
  
  Index: Node.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/Node.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Node.java	2001/03/19 17:14:46	1.6
  +++ Node.java	2001/09/07 05:02:15	1.7
  @@ -63,6 +63,8 @@
   import org.apache.velocity.runtime.parser.Token;
   
   import org.apache.velocity.exception.MethodInvocationException;
  +import org.apache.velocity.exception.ParseErrorException;
  +import org.apache.velocity.exception.ResourceNotFoundException;
   
   /**
    *  All AST nodes must implement this interface.  It provides basic
  @@ -126,7 +128,7 @@
           throws MethodInvocationException;
   
       public boolean render( InternalContextAdapter context, Writer writer)
  -        throws IOException,MethodInvocationException;
  +        throws IOException,MethodInvocationException, ParseErrorException, ResourceNotFoundException;
   
       public Object execute(Object o, InternalContextAdapter context)
         throws MethodInvocationException;
  
  
  
  1.11      +5 -1      jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java
  
  Index: SimpleNode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SimpleNode.java	2001/08/07 21:56:30	1.10
  +++ SimpleNode.java	2001/09/07 05:02:15	1.11
  @@ -66,7 +66,11 @@
   import org.apache.velocity.runtime.parser.ParserTreeConstants;
   
   import org.apache.velocity.exception.MethodInvocationException;
  +import org.apache.velocity.exception.MethodInvocationException;
  +import org.apache.velocity.exception.ParseErrorException;
  +import org.apache.velocity.exception.ResourceNotFoundException;
   
  +
   public class SimpleNode implements Node
   {
       protected RuntimeServices rsvc = null;
  @@ -259,7 +263,7 @@
       }        
   
       public boolean render( InternalContextAdapter context, Writer writer)
  -        throws IOException, MethodInvocationException
  +        throws IOException, MethodInvocationException, ParseErrorException, ResourceNotFoundException
       {
           int i, k = jjtGetNumChildren();
   
  
  
  

Mime
View raw message