You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by mo...@apache.org on 2003/01/24 07:41:23 UTC

cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/impl DynamicTagLibrary.java

morgand     2003/01/23 22:41:23

  Modified:    jelly/jelly-tags/ant/src/java/org/apache/commons/jelly/tags/ant
                        AntTagLibrary.java
               jelly/jelly-tags/bean/src/java/org/apache/commons/jelly/tags/bean
                        BeanTagLibrary.java
               jelly/jelly-tags/bean/src/test/org/apache/commons/jelly/tags/bean
                        MyTagLibrary.java
               jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing
                        SwingTagLibrary.java
               jelly/src/java/org/apache/commons/jelly Tag.java
                        TagLibrary.java TagSupport.java
               jelly/src/java/org/apache/commons/jelly/impl
                        DynamicTagLibrary.java
  Log:
  converting Exceptions to JellyExceptions
  
  Revision  Changes    Path
  1.27      +2 -2      jakarta-commons-sandbox/jelly/jelly-tags/ant/src/java/org/apache/commons/jelly/tags/ant/AntTagLibrary.java
  
  Index: AntTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/ant/src/java/org/apache/commons/jelly/tags/ant/AntTagLibrary.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- AntTagLibrary.java	24 Jan 2003 05:26:12 -0000	1.26
  +++ AntTagLibrary.java	24 Jan 2003 06:41:22 -0000	1.27
  @@ -186,7 +186,7 @@
   
   
       /** Creates a new script to execute the given tag name and attributes */
  -    public TagScript createTagScript(String name, Attributes attributes) throws Exception {
  +    public TagScript createTagScript(String name, Attributes attributes) throws JellyException {
           TagScript answer = createCustomTagScript(name, attributes);
           if ( answer == null ) {
               answer = new TagScript(
  @@ -203,7 +203,7 @@
       /** 
        * @return a new TagScript for any custom, statically defined tags, like 'fileScanner'
        */
  -    public TagScript createCustomTagScript(String name, Attributes attributes) throws Exception {
  +    public TagScript createCustomTagScript(String name, Attributes attributes) throws JellyException {
           // custom Ant tags
           if ( name.equals("fileScanner") ) {      
               return new TagScript(
  
  
  
  1.3       +7 -7      jakarta-commons-sandbox/jelly/jelly-tags/bean/src/java/org/apache/commons/jelly/tags/bean/BeanTagLibrary.java
  
  Index: BeanTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/bean/src/java/org/apache/commons/jelly/tags/bean/BeanTagLibrary.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BeanTagLibrary.java	24 Jan 2003 05:26:13 -0000	1.2
  +++ BeanTagLibrary.java	24 Jan 2003 06:41:22 -0000	1.3
  @@ -104,7 +104,7 @@
       //-------------------------------------------------------------------------                    
       public TagScript createTagScript(
           final String name, final Attributes attributes
  -    ) throws Exception {
  +    ) throws JellyException {
   
           // check for standard tags first                        
           TagScript answer = super.createTagScript(name, attributes);
  @@ -122,7 +122,7 @@
       /** 
        * Factory method to create a TagFactory for a given tag attribute and attributes
        */
  -    protected TagFactory createTagFactory(String name, Attributes attributes) throws Exception {
  +    protected TagFactory createTagFactory(String name, Attributes attributes) throws JellyException {
   
           return new TagFactory() {
               public Tag createTag(String name, Attributes attributes) throws JellyException {
  
  
  
  1.4       +6 -6      jakarta-commons-sandbox/jelly/jelly-tags/bean/src/test/org/apache/commons/jelly/tags/bean/MyTagLibrary.java
  
  Index: MyTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/bean/src/test/org/apache/commons/jelly/tags/bean/MyTagLibrary.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MyTagLibrary.java	24 Jan 2003 05:26:13 -0000	1.3
  +++ MyTagLibrary.java	24 Jan 2003 06:41:22 -0000	1.4
  @@ -85,7 +85,7 @@
       
       // TagLibrary interface
       //-------------------------------------------------------------------------
  -    public TagScript createTagScript(String name, Attributes attributes) throws Exception {
  +    public TagScript createTagScript(String name, Attributes attributes) throws JellyException {
   
           TagFactory factory = new TagFactory() {
               public Tag createTag(String name, Attributes attributes) throws JellyException {
  
  
  
  1.19      +1 -1      jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/SwingTagLibrary.java
  
  Index: SwingTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/SwingTagLibrary.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- SwingTagLibrary.java	24 Jan 2003 05:26:13 -0000	1.18
  +++ SwingTagLibrary.java	24 Jan 2003 06:41:22 -0000	1.19
  @@ -144,7 +144,7 @@
       }
   
       /** Creates a new script to execute the given tag name and attributes */
  -    public TagScript createTagScript(String name, Attributes attributes) throws Exception {
  +    public TagScript createTagScript(String name, Attributes attributes) throws JellyException {
           TagScript answer = super.createTagScript(name, attributes);
           if ( answer == null ) {
               final Factory factory = getFactory( name );
  
  
  
  1.11      +7 -7      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/Tag.java
  
  Index: Tag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/Tag.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Tag.java	30 Oct 2002 19:16:26 -0000	1.10
  +++ Tag.java	24 Jan 2003 06:41:22 -0000	1.11
  @@ -103,7 +103,7 @@
       /** 
        * Sets the context in which the tag will be run 
        */
  -    public void setContext(JellyContext context) throws Exception;
  +    public void setContext(JellyContext context) throws JellyException;
   
       /** 
        * Evaluates this tag after all the tags properties have been initialized.
  @@ -113,6 +113,6 @@
       /**
        * A helper method to invoke this tags body
        */
  -    public void invokeBody(XMLOutput output) throws Exception;
  +    public void invokeBody(XMLOutput output) throws JellyException;
       
   }
  
  
  
  1.21      +6 -6      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/TagLibrary.java
  
  Index: TagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/TagLibrary.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- TagLibrary.java	24 Jan 2003 05:26:13 -0000	1.20
  +++ TagLibrary.java	24 Jan 2003 06:41:22 -0000	1.21
  @@ -114,7 +114,7 @@
   
       /** Creates a new script to execute the given tag name and attributes */
       public TagScript createTagScript(String name, Attributes attributes)
  -        throws Exception {
  +        throws JellyException {
   
           Object value = tags.get(name);
           if (value instanceof Class) {
  
  
  
  1.21      +15 -10    jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/TagSupport.java
  
  Index: TagSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/TagSupport.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- TagSupport.java	10 Dec 2002 01:30:26 -0000	1.20
  +++ TagSupport.java	24 Jan 2003 06:41:22 -0000	1.21
  @@ -62,6 +62,7 @@
   package org.apache.commons.jelly;
   
   import java.io.StringWriter;
  +import java.io.UnsupportedEncodingException;
   import java.util.Arrays;
   import java.util.Collection;
   import java.util.Iterator;
  @@ -221,14 +222,14 @@
       }
       
       /** Sets the context in which the tag will be run */
  -    public void setContext(JellyContext context) throws Exception {
  +    public void setContext(JellyContext context) throws JellyException {
           this.context = context;
       }    
       
       /**
        * Invokes the body of this tag using the given output
        */
  -    public void invokeBody(XMLOutput output) throws Exception {
  +    public void invokeBody(XMLOutput output) throws JellyException {
           getBody().run(context, output);
       }
       
  @@ -265,7 +266,7 @@
        *
        * @return the text evaluation of the body
        */
  -    protected String getBodyText() throws Exception {
  +    protected String getBodyText() throws JellyException {
           StringWriter writer = new StringWriter();
           invokeBody(XMLOutput.createXMLOutput(writer));
           return writer.toString();
  @@ -279,9 +280,13 @@
        *
        * @return the text evaluation of the body
        */
  -    protected String getBodyText(boolean shouldEscape) throws Exception {
  +    protected String getBodyText(boolean shouldEscape) throws JellyException {
           StringWriter writer = new StringWriter();
  -        invokeBody(XMLOutput.createXMLOutput(writer,shouldEscape));
  +        try {
  +          invokeBody(XMLOutput.createXMLOutput(writer,shouldEscape));
  +        } catch (UnsupportedEncodingException e) {
  +            throw new JellyException(e.toString());
  +        }
           return writer.toString();
       }
   
  
  
  
  1.11      +1 -1      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/impl/DynamicTagLibrary.java
  
  Index: DynamicTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/impl/DynamicTagLibrary.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DynamicTagLibrary.java	24 Jan 2003 05:26:13 -0000	1.10
  +++ DynamicTagLibrary.java	24 Jan 2003 06:41:23 -0000	1.11
  @@ -92,7 +92,7 @@
   
       /** Creates a new script to execute the given tag name and attributes */
       public TagScript createTagScript(final String name, final Attributes attributes)
  -        throws Exception {
  +        throws JellyException {
   
           return new TagScript(
               new TagFactory() {
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>