commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl TagFactory.java Attribute.java DynamicTagLibrary.java BeanSource.java CompositeTextScriptBlock.java DynamicBeanTag.java BreakException.java DynamicTag.java Embedded.java StaticTag.java CollectionTag.java ExpressionScript.java TagScript.java TextScript.java ScriptBlock.java DynamicDynaBeanTag.java TagLibraryResolver.java DefaultTagFactory.java StaticTagScript.java DefaultTagLibraryResolver.java
Date Thu, 09 Sep 2004 12:26:23 GMT
dion        2004/09/09 05:26:23

  Modified:    jelly/src/java/org/apache/commons/jelly/impl TagFactory.java
                        Attribute.java DynamicTagLibrary.java
                        BeanSource.java CompositeTextScriptBlock.java
                        DynamicBeanTag.java BreakException.java
                        DynamicTag.java Embedded.java StaticTag.java
                        CollectionTag.java ExpressionScript.java
                        TagScript.java TextScript.java ScriptBlock.java
                        DynamicDynaBeanTag.java TagLibraryResolver.java
                        DefaultTagFactory.java StaticTagScript.java
                        DefaultTagLibraryResolver.java
  Log:
  Fix license file whitespace
  
  Revision  Changes    Path
  1.7       +5 -5      jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/TagFactory.java
  
  Index: TagFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/TagFactory.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TagFactory.java	24 Feb 2004 14:03:06 -0000	1.6
  +++ TagFactory.java	9 Sep 2004 12:26:22 -0000	1.7
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -20,9 +20,9 @@
   
   import org.xml.sax.Attributes;
   
  -/** 
  +/**
    * <p><code>TagFactory</code> represents a Factory of {@link Tag} instances.</p>
  - * 
  + *
    * <b>Note</b> that this class should be re-entrant and used
    * concurrently by multiple threads.
    *
  
  
  
  1.6       +10 -10    jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/Attribute.java
  
  Index: Attribute.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/Attribute.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Attribute.java	24 Feb 2004 14:03:06 -0000	1.5
  +++ Attribute.java	9 Sep 2004 12:26:22 -0000	1.6
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -17,10 +17,10 @@
   
   import org.apache.commons.jelly.expression.Expression;
   
  -/** 
  +/**
    * Represents the attribute definition used by dynamic tags, such as whether the attribute is required
    * or any default values etc.
  - * 
  + *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
    * @version $Revision$
    */
  @@ -28,19 +28,19 @@
   
       /** the name of the attribute */
       private String name;
  -    
  +
       /** the default value expression */
       private Expression defaultValue;
  -    
  +
       /** whether this attribute is required */
       private boolean required;
  -    
  +
       public Attribute() {
       }
   
       // Properties
  -    //-------------------------------------------------------------------------   
  -                     
  +    //-------------------------------------------------------------------------
  +
       /**
        * Returns whether this attribute is required.
        * @return boolean
  
  
  
  1.14      +12 -12    jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/DynamicTagLibrary.java
  
  Index: DynamicTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/DynamicTagLibrary.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DynamicTagLibrary.java	24 Feb 2004 14:03:06 -0000	1.13
  +++ DynamicTagLibrary.java	9 Sep 2004 12:26:22 -0000	1.14
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -24,7 +24,7 @@
   import org.apache.commons.jelly.TagLibrary;
   import org.xml.sax.Attributes;
   
  -/** 
  +/**
    * <p><code>DynamicTagLibrary</code> represents a TagLibrary which
    * gets created by running a Jelly script.</p>
    *
  @@ -62,14 +62,14 @@
           throws JellyException {
   
           Object value = templates.get(name);
  -        if ( value instanceof Script ) {            
  +        if ( value instanceof Script ) {
               Script template = (Script) value;
               return new DynamicTag(template);
           }
           else if ( value instanceof TagFactory ) {
               TagFactory factory = (TagFactory) value;
               return factory.createTag(name, attributes);
  -        } 
  +        }
           else if ( parent != null ) {
               // delegate to the parent
               return parent.createTag(name, attributes);
  @@ -79,14 +79,14 @@
       }
   
       /**
  -     * Creates a new tag with the given name and template 
  +     * Creates a new tag with the given name and template
        */
       public void registerDynamicTag(String name, Script template) {
           templates.put(name, template);
       }
   
       /**
  -     * Creates a new Jelly Bean Tag with the given name 
  +     * Creates a new Jelly Bean Tag with the given name
        */
       public void registerBeanTag(String name, TagFactory factory) {
           templates.put(name, factory);
  @@ -96,7 +96,7 @@
        * Returns the script associated with the given tag name
        *
        * @param name The tag name
  -     * @return The script associated with <code>name</code>, or 
  +     * @return The script associated with <code>name</code>, or
        *         <code>null</code> if the tag doesn't exist or isn't a script
        */
       public Script getDynamicTag(String name) {
  @@ -109,7 +109,7 @@
        * <p/>
        * If the tag is not registered within this library, the set of
        * parent libraries will be searched.
  -     * 
  +     *
        * @param name The tag name
        * @return The tag library containing the named tag, or <code>null</code>
        *         if the tag is not registered.
  @@ -118,7 +118,7 @@
           DynamicTagLibrary result = null;
           if (templates.get(name) != null) {
               result = this;
  -        } 
  +        }
           else if (parent instanceof DynamicTagLibrary) {
               result = ((DynamicTagLibrary) parent).find(name);
           }
  @@ -126,7 +126,7 @@
       }
   
       // Properties
  -    //-------------------------------------------------------------------------     
  +    //-------------------------------------------------------------------------
       public String getUri() {
           return uri;
       }
  
  
  
  1.7       +5 -5      jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/BeanSource.java
  
  Index: BeanSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/BeanSource.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BeanSource.java	24 Feb 2004 14:03:06 -0000	1.6
  +++ BeanSource.java	9 Sep 2004 12:26:22 -0000	1.7
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -17,7 +17,7 @@
   
   import org.apache.commons.jelly.JellyTagException;
   
  -/** 
  +/**
    * A tag which is associated with a JavaBean, such as a {@link DynamicBeanTag}
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  @@ -25,7 +25,7 @@
    */
   public interface BeanSource {
   
  -    /** 
  +    /**
        * @return the bean to which this tag is associated
        */
       public Object getBean() throws JellyTagException;
  
  
  
  1.6       +4 -4      jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/CompositeTextScriptBlock.java
  
  Index: CompositeTextScriptBlock.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/CompositeTextScriptBlock.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CompositeTextScriptBlock.java	24 Feb 2004 14:03:06 -0000	1.5
  +++ CompositeTextScriptBlock.java	9 Sep 2004 12:26:22 -0000	1.6
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -16,7 +16,7 @@
   package org.apache.commons.jelly.impl;
   
   
  -/** 
  +/**
    * <p><code>CompositeTextScriptBlock</code> represents a text body of a
    * a tag which contains expressions, so that whitespace trimming
    * can be handled differently.</p>
  
  
  
  1.16      +33 -33    jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/DynamicBeanTag.java
  
  Index: DynamicBeanTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/DynamicBeanTag.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DynamicBeanTag.java	5 Sep 2004 11:39:51 -0000	1.15
  +++ DynamicBeanTag.java	9 Sep 2004 12:26:22 -0000	1.16
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -33,9 +33,9 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  -/** 
  +/**
    * This tag is bound onto a Java Bean class. When the tag is invoked a bean will be created
  - * using the tags attributes. 
  + * using the tags attributes.
    * The bean may also have an invoke method called invoke(), run(), execute() or some such method
    * which will be invoked after the bean has been configured.</p>
    *
  @@ -50,18 +50,18 @@
   
       /** Empty arguments for Method.invoke() */
       private static final Object[] emptyArgs = {};
  -    
  +
       /** the bean class */
       private Class beanClass;
  -    
  +
       /** the current bean instance */
       private Object bean;
  -    
  +
       /** the method to invoke on the bean */
  -    private Method method;    
  +    private Method method;
   
  -    /** 
  -     * the tag attribute name that is used to declare the name 
  +    /**
  +     * the tag attribute name that is used to declare the name
        * of the variable to export after running this tag
        */
       private String variableNameAttribute;
  @@ -73,12 +73,12 @@
       private Set setAttributesSet = new HashSet();
   
       /** the attribute definitions */
  -    private Map attributes;    
  -        
  +    private Map attributes;
  +
       /**
  -     * 
  +     *
        * @param beanClass Class of the bean that will receive the setter events
  -     * @param attributes 
  +     * @param attributes
        * @param variableNameAttribute
        * @param method method of the Bean to invoke after the attributes have been set.  Can be null.
        */
  @@ -100,10 +100,10 @@
               throw new JellyTagException("Could not instantiate dynabean",e);
           }
   
  -        setAttributesSet.clear();                    
  +        setAttributesSet.clear();
       }
   
  -    public void setAttribute(String name, Object value) throws JellyTagException {        
  +    public void setAttribute(String name, Object value) throws JellyTagException {
           boolean isVariableName = false;
           if (variableNameAttribute != null ) {
               if ( variableNameAttribute.equals( name ) ) {
  @@ -117,23 +117,23 @@
               }
           }
           if (! isVariableName) {
  -            
  +
               // #### strictly speaking we could
               // know what attributes are specified at compile time
  -            // so this dynamic set is unnecessary            
  +            // so this dynamic set is unnecessary
               setAttributesSet.add(name);
  -            
  +
               // we could maybe implement attribute specific validation here
  -            
  +
               super.setAttribute(name, value);
           }
       }
   
       // Tag interface
  -    //-------------------------------------------------------------------------                    
  +    //-------------------------------------------------------------------------
       public void doTag(XMLOutput output) throws JellyTagException {
   
  -        // lets find any attributes that are not set and 
  +        // lets find any attributes that are not set and
           for ( Iterator iter = attributes.values().iterator(); iter.hasNext(); ) {
               Attribute attribute = (Attribute) iter.next();
               String name = attribute.getName();
  @@ -147,7 +147,7 @@
                   if ( expression != null ) {
                       value = expression.evaluate(context);
                   }
  -                
  +
                   // only set non-null values?
                   if ( value != null ) {
                       super.setAttribute(name, value);
  @@ -163,7 +163,7 @@
               tag.setContext(getContext());
               tag.setParent(getParent());
               ((Tag) bean).doTag(output);
  -            
  +
               return;
           }
   
  @@ -173,7 +173,7 @@
           if ( var != null ) {
               context.setVariable(var, bean);
           }
  -        
  +
           // now, I may invoke the 'execute' method if I have one
           if ( method != null ) {
               try {
  @@ -191,11 +191,11 @@
                   Throwable inner = e.getTargetException();
   
                   throw new JellyTagException(inner);
  -                
  +
               }
           }
       }
  -    
  +
       /**
        * Report the state of the bean when method invocation fails
        * so that the user can determine any problems that might
  @@ -208,22 +208,22 @@
       private void methodInvocationException(Object bean, Method method, Exception e) throws JellyTagException {
           log.error("Could not invoke " + method, e);
           BeanMap beanMap = new BeanMap(bean);
  -        
  +
           log.error("Bean properties:");
           for (Iterator i = beanMap.keySet().iterator(); i.hasNext();) {
               String property = (String) i.next();
               Object value = beanMap.get(property);
               log.error(property + " -> " + value);
           }
  -        
  +
           log.error(beanMap);
           throw new JellyTagException(e);
       }
  -    
  +
       // Properties
  -    //-------------------------------------------------------------------------                    
  +    //-------------------------------------------------------------------------
       /**
  -     * @return the bean that has just been created 
  +     * @return the bean that has just been created
        */
       public Object getBean() {
           return bean;
  
  
  
  1.7       +6 -6      jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/BreakException.java
  
  Index: BreakException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/BreakException.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BreakException.java	24 Feb 2004 14:03:06 -0000	1.6
  +++ BreakException.java	9 Sep 2004 12:26:22 -0000	1.7
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -18,8 +18,8 @@
   
   import org.apache.commons.jelly.JellyTagException;
   
  -/** 
  - * <p><code>BreakException</code> is used to terminate loops such as 
  +/**
  + * <p><code>BreakException</code> is used to terminate loops such as
    * &lt;forEach&gt; and &lt;while&gt; tags.</p>
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  @@ -27,7 +27,7 @@
    */
   
   public class BreakException extends JellyTagException {
  -    
  +
       public BreakException() {
           super("Break exception, terminating the parent loop");
       }
  
  
  
  1.10      +12 -12    jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/DynamicTag.java
  
  Index: DynamicTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/DynamicTag.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DynamicTag.java	24 Feb 2004 14:03:06 -0000	1.9
  +++ DynamicTag.java	9 Sep 2004 12:26:22 -0000	1.10
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -27,10 +27,10 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  -/** 
  +/**
    * <p><code>DynamicTag</code> is a tag that is created from
  - * inside a Jelly script as a Jelly template and will invoke a 
  - * given script, passing in its instantiation attributes 
  + * inside a Jelly script as a Jelly template and will invoke a
  + * given script, passing in its instantiation attributes
    * as variables and will allow the template to invoke its instance body.</p>
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  @@ -56,13 +56,13 @@
   
   
       // Tag interface
  -    //-------------------------------------------------------------------------                    
  +    //-------------------------------------------------------------------------
       public void doTag(XMLOutput output) throws JellyTagException {
           if ( log.isDebugEnabled() ) {
               log.debug("Invoking dynamic tag with attributes: " + attributes);
           }
           attributes.put("org.apache.commons.jelly.body", getBody());
  -        
  +
           // create new context based on current attributes
           JellyContext newJellyContext = context.newJellyContext(attributes);
           Map attrMap = new HashMap();
  @@ -73,22 +73,22 @@
                   Object value = this.attributes.get( key );
                   attrMap.put( key, value );
                   attrMap.put( key.substring( 0, key.length()-4 ), value );
  -            }  
  +            }
           }
           newJellyContext.setVariable( "attrs", attrMap );
           getTemplate().run(newJellyContext, output);
       }
   
       // DynaTag interface
  -    //-------------------------------------------------------------------------                    
  +    //-------------------------------------------------------------------------
       public void setAttribute(String name, Object value) {
           attributes.put(name, value);
           attributes.put(name + "Attr", value);
       }
   
       // Properties
  -    //-------------------------------------------------------------------------                    
  -    /** The template to be executed by this tag which may well 
  +    //-------------------------------------------------------------------------
  +    /** The template to be executed by this tag which may well
        * invoke this instances body from inside the template
        */
       public Script getTemplate() {
  
  
  
  1.6       +14 -14    jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/Embedded.java
  
  Index: Embedded.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/Embedded.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Embedded.java	2 Sep 2004 06:58:34 -0000	1.5
  +++ Embedded.java	9 Sep 2004 12:26:22 -0000	1.6
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -55,7 +55,7 @@
    *         String errorMsg=embedded.getErrorMsg();<br/>
    *     }<br/>
    *  </code>  <br/>
  - * 
  + *
    * @author <a href="mailto:vinayc@apache.org">Vinay Chandran</a>
    */
   public class Embedded {
  @@ -83,12 +83,12 @@
   
       /**
        * Default Constructor
  -     * 
  +     *
        */
       public Embedded() {
           //m_context.setClassLoader(new TagLibraryClassLoader(m_context));
       }
  -    
  +
       /**
        * Method setContext.
        * @param context
  @@ -115,7 +115,7 @@
       }
   
       /**
  -     * Set the input script 
  +     * Set the input script
        * @param scriptAsString
        */
       public void setScript(String scriptAsString) {
  @@ -138,7 +138,7 @@
       }
   
       /**
  -     * @return the URL for the relative file name or absolute URL 
  +     * @return the URL for the relative file name or absolute URL
        */
       private URL resolveURL(String name) throws MalformedURLException {
           File file = new File(name);
  @@ -147,9 +147,9 @@
           }
           return new URL(name);
       }
  -    
  +
       /**
  -     * Set the input stream 
  +     * Set the input stream
        * @param scriptAsInputStream
        */
       public void setScript(InputStream scriptAsInputStream) {
  @@ -158,7 +158,7 @@
       }
   
       /**
  -     * Compile the script 
  +     * Compile the script
        */
       private void compileScriptAndKeep() {
           XMLParser parser = new XMLParser();
  @@ -190,7 +190,7 @@
               XMLOutput.createXMLOutput(new OutputStreamWriter(m_outputStream));
       }
   
  -    /** 
  +    /**
        * Registers the given tag library class name against the given namespace URI.
        * The class will be loaded via the given ClassLoader
        * This should be called before the parser is used.
  @@ -200,7 +200,7 @@
               m_context.registerTagLibrary(namespaceURI, className);
       }
   
  -    /** 
  +    /**
        * Registers the given tag library against the given namespace URI.
        * This should be called before the parser is used.
        */
  @@ -227,7 +227,7 @@
   
       /**
        * Execute the jelly script and capture the errors (ifany)within.
  -     * 
  +     *
        * @throws JellyException
        */
       public boolean execute() {
  
  
  
  1.19      +25 -25    jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/StaticTag.java
  
  Index: StaticTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/StaticTag.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- StaticTag.java	5 Sep 2004 14:32:16 -0000	1.18
  +++ StaticTag.java	9 Sep 2004 12:26:22 -0000	1.19
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -22,7 +22,7 @@
   import org.xml.sax.SAXException;
   import org.xml.sax.helpers.AttributesImpl;
   
  -/** 
  +/**
    * <p><code>StaticTag</code> represents a static XML element
    * which echos itself to XMLOutput when it is invoked.</p>
    *
  @@ -31,34 +31,34 @@
    */
   
   public class StaticTag extends DynaTagSupport {
  -    
  +
       /** The namespace URI */
       private String uri;
  -    
  +
       /** The qualified name */
       private String qname;
  -    
  +
       /** The local name */
       private String localName;
  -    
  +
       /** The XML Attributes */
       private AttributesImpl attributes = new AttributesImpl();
  -    
  +
       public StaticTag() {
       }
  -    
  +
       public StaticTag(String uri, String localName, String qname) {
           this.uri = uri;
           this.localName = localName;
           this.qname = qname;
       }
  -    
  +
       public String toString() {
           return super.toString() + "[qname=" + qname + ";attributes=" + attributes + "]";
       }
  -    
  +
       // Tag interface
  -    //-------------------------------------------------------------------------                    
  +    //-------------------------------------------------------------------------
       public void doTag(XMLOutput output) throws JellyTagException {
           try {
               output.startElement(uri, localName, qname, attributes);
  @@ -68,37 +68,37 @@
               throw new JellyTagException(e);
           }
       }
  -    
  +
       // DynaTag interface
  -    //-------------------------------------------------------------------------                    
  +    //-------------------------------------------------------------------------
       public void setAttribute(String name, Object value) throws JellyTagException {
           // ### we'll assume that all attributes are in no namespace!
           // ### this is severely limiting!
  -        // ### - Tag attributes should allow for namespace aware 
  +        // ### - Tag attributes should allow for namespace aware
           int index = attributes.getIndex("", name);
           if (index >= 0) {
               attributes.removeAttribute(index);
           }
  -        // treat null values as no attribute 
  +        // treat null values as no attribute
           if (value != null) {
               attributes.addAttribute("", name, name, "CDATA", value.toString());
           }
       }
  -    
  +
       // Properties
  -    //-------------------------------------------------------------------------                    
  +    //-------------------------------------------------------------------------
       public String getUri() {
           return uri;
       }
  -    
  +
       public void setUri(String uri) {
           this.uri = uri;
       }
  -    
  +
       public String getQName() {
           return qname;
       }
  -    
  +
       public void setQName(String qname) {
           this.qname = qname;
           int idx = qname.indexOf(':');
  @@ -109,11 +109,11 @@
               this.localName = qname;
           }
       }
  -    
  +
       public String getLocalName() {
           return localName;
       }
  -    
  +
       public void setLocalName(String localName) {
           this.localName = localName;
           // FIXME This just doesn't seem right or work...
  
  
  
  1.6       +5 -5      jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/CollectionTag.java
  
  Index: CollectionTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/CollectionTag.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CollectionTag.java	24 Feb 2004 14:03:06 -0000	1.5
  +++ CollectionTag.java	9 Sep 2004 12:26:22 -0000	1.6
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -17,7 +17,7 @@
   
   import org.apache.commons.jelly.JellyTagException;
   
  -/** 
  +/**
    * A tag which is capable of consuming objects, such as a &lt;useList&gt; tag
    * such that nested objects will be added to the parent tag.
    *
  @@ -26,7 +26,7 @@
    */
   public interface CollectionTag {
   
  -    /** 
  +    /**
        * @return adds an item to the tags collection
        */
       public void addItem(Object value) throws JellyTagException;
  
  
  
  1.8       +11 -11    jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/ExpressionScript.java
  
  Index: ExpressionScript.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/ExpressionScript.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ExpressionScript.java	24 Feb 2004 14:03:06 -0000	1.7
  +++ ExpressionScript.java	9 Sep 2004 12:26:22 -0000	1.8
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -23,17 +23,17 @@
   
   import org.xml.sax.SAXException;
   
  -/** 
  +/**
    * <p><code>ExpressionScript</code> outputs the value of an expression as text.</p>
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
    * @version $Revision$
    */
   public class ExpressionScript implements Script {
  - 
  +
       /** the expression evaluated as a String and output by this script */
       private Expression expression;
  - 
  +
       public ExpressionScript() {
       }
   
  @@ -44,7 +44,7 @@
       public String toString() {
           return super.toString() + "[expression=" + expression + "]";
       }
  - 
  +
       /** @return the expression evaluated as a String and output by this script */
       public Expression getExpression() {
           return expression;
  @@ -54,9 +54,9 @@
       public void setExpression(Expression expression) {
           this.expression = expression;
       }
  - 
  +
       // Script interface
  -    //-------------------------------------------------------------------------                
  +    //-------------------------------------------------------------------------
       public Script compile() {
           return this;
       }
  @@ -65,13 +65,13 @@
       public void run(JellyContext context, XMLOutput output) throws JellyTagException {
           String text = expression.evaluateAsString(context);
           if ( text != null ) {
  -            
  +
               try {
                 output.write(text);
               } catch (SAXException e) {
                   throw new JellyTagException("Could not write to XMLOutput",e);
               }
  -            
  +
           }
       }
   }
  
  
  
  1.43      +84 -84    jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/TagScript.java
  
  Index: TagScript.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/TagScript.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- TagScript.java	8 Sep 2004 04:27:59 -0000	1.42
  +++ TagScript.java	9 Sep 2004 12:26:22 -0000	1.43
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -44,9 +44,9 @@
   import org.xml.sax.Locator;
   import org.xml.sax.SAXException;
   
  -/** 
  +/**
    * <p><code>TagScript</code> is a Script that evaluates a custom tag.</p>
  - * 
  + *
    * <b>Note</b> that this class should be re-entrant and used
    * concurrently by multiple threads.
    *
  @@ -58,11 +58,11 @@
       /** The Log to which logging calls will be made. */
       private static final Log log = LogFactory.getLog(TagScript.class);
   
  -    /** 
  +    /**
        * Thread local storage for the tag used by the current thread.
        * This allows us to pool tag instances, per thread to reduce object construction
        * over head, if we need it.
  -     * 
  +     *
        * Note that we could use the stack and create a new tag for each invocation
        * if we made a slight change to the Script API to pass in the parent tag.
        */
  @@ -70,17 +70,17 @@
   
       /** The attribute expressions that are created */
       protected Map attributes = new Hashtable();
  -    
  +
       /** the optional namespaces Map of prefix -> URI of this single Tag */
       private Map tagNamespacesMap;
  -    
  -    /** 
  +
  +    /**
        * The optional namespace context mapping all prefixes -> URIs in scope
        * at the point this tag is used.
        * This Map is only created lazily if it is required by the NamespaceAwareTag.
        */
       private Map namespaceContext;
  -    
  +
       /** the Jelly file which caused the problem */
       private String fileName;
   
  @@ -92,38 +92,38 @@
   
       /** the line number of the tag */
       private int lineNumber = -1;
  -    
  +
       /** the column number of the tag */
       private int columnNumber = -1;
   
       /** the factory of Tag instances */
       private TagFactory tagFactory;
  -    
  +
       /** the body script used for this tag */
       private Script tagBody;
  -    
  +
       /** the parent TagScript */
       private TagScript parent;
   
       /** the SAX attributes */
       private Attributes saxAttributes;
  -        
  -    /** 
  -     * @return a new TagScript based on whether 
  -     * the given Tag class is a bean tag or DynaTag 
  +
  +    /**
  +     * @return a new TagScript based on whether
  +     * the given Tag class is a bean tag or DynaTag
        */
       public static TagScript newInstance(Class tagClass) {
           TagFactory factory = new DefaultTagFactory(tagClass);
           return new TagScript(factory);
       }
  -    
  +
       public TagScript() {
       }
   
       public TagScript(TagFactory tagFactory) {
           this.tagFactory = tagFactory;
       }
  -    
  +
       public String toString() {
           return super.toString() + "[tag=" + elementName + ";at=" + lineNumber + ":" + columnNumber + "]";
       }
  @@ -137,9 +137,9 @@
           }
           return this;
       }
  -    
  +
       /**
  -     * Sets the optional namespaces prefix -> URI map of 
  +     * Sets the optional namespaces prefix -> URI map of
        * the namespaces attached to this Tag
        */
       public void setTagNamespacesMap(Map tagNamespacesMap) {
  @@ -149,7 +149,7 @@
           }
           this.tagNamespacesMap = tagNamespacesMap;
       }
  -        
  +
       /**
        * Configures this TagScript from the SAX Locator, setting the column
        * and line numbers
  @@ -159,9 +159,9 @@
           setColumnNumber( locator.getColumnNumber() );
       }
   
  -    
  +
       /** Add an initialization attribute for the tag.
  -     * This method must be called after the setTag() method 
  +     * This method must be called after the setTag() method
        */
       public void addAttribute(String name, Expression expression) {
           if (log.isDebugEnabled()) {
  @@ -169,9 +169,9 @@
           }
           attributes.put(name, expression);
       }
  -    
  +
       // Script interface
  -    //-------------------------------------------------------------------------                
  +    //-------------------------------------------------------------------------
   
       /** Evaluates the body of a tag */
       public void run(JellyContext context, XMLOutput output) throws JellyTagException {
  @@ -184,10 +184,10 @@
                   return;
               }
               tag.setContext(context);
  -    
  -            if ( tag instanceof DynaTag ) {        
  +
  +            if ( tag instanceof DynaTag ) {
                   DynaTag dynaTag = (DynaTag) tag;
  -        
  +
                   // ### probably compiling this to 2 arrays might be quicker and smaller
                   for (Iterator iter = attributes.entrySet().iterator(); iter.hasNext();) {
                       Map.Entry entry = (Map.Entry) iter.next();
  @@ -195,7 +195,7 @@
                       Expression expression = (Expression) entry.getValue();
   
                       Class type = dynaTag.getAttributeType(name);
  -                    Object value = null;        
  +                    Object value = null;
                       if (type != null && type.isAssignableFrom(Expression.class) && !type.isAssignableFrom(Object.class)) {
                           value = expression;
                       }
  @@ -219,7 +219,7 @@
                       }
                       Class type = property.getType();
   
  -                    Object value = null;        
  +                    Object value = null;
                       if (type.isAssignableFrom(Expression.class) && !type.isAssignableFrom(Object.class)) {
                           value = expression;
                       }
  @@ -229,9 +229,9 @@
                       dynaBean.set(name, value);
                   }
               }
  -        
  +
               tag.doTag(output);
  -        } 
  +        }
           catch (JellyTagException e) {
               handleException(e);
           }
  @@ -240,23 +240,23 @@
           }
           catch (RuntimeException e) {
               handleException(e);
  -        } 
  +        }
           catch (Error e) {
              /*
               * Not sure if we should be converting errors to exceptions,
  -            * but not trivial to remove because JUnit tags throw 
  +            * but not trivial to remove because JUnit tags throw
               * Errors in the normal course of operation.  Hmm...
               */
               handleException(e);
           }
  -        
  +
       }
  -    
  -    
  +
  +
       // Properties
  -    //-------------------------------------------------------------------------                
  +    //-------------------------------------------------------------------------
   
  -    /** 
  +    /**
        * @return the tag to be evaluated, creating it lazily if required.
        */
       public Tag getTag() throws JellyException {
  @@ -319,57 +319,57 @@
           this.tagBody = tagBody;
       }
   
  -    /** 
  -     * @return the Jelly file which caused the problem 
  +    /**
  +     * @return the Jelly file which caused the problem
        */
       public String getFileName() {
           return fileName;
       }
   
  -    /** 
  -     * Sets the Jelly file which caused the problem 
  +    /**
  +     * Sets the Jelly file which caused the problem
        */
       public void setFileName(String fileName) {
           this.fileName = fileName;
       }
  -    
   
  -    /** 
  +
  +    /**
        * @return the element name which caused the problem
        */
       public String getElementName() {
           return elementName;
       }
   
  -    /** 
  +    /**
        * Sets the element name which caused the problem
        */
       public void setElementName(String elementName) {
           this.elementName = elementName;
       }
  -    /** 
  -     * @return the line number of the tag 
  +    /**
  +     * @return the line number of the tag
        */
       public int getLineNumber() {
           return lineNumber;
       }
  -    
  -    /** 
  -     * Sets the line number of the tag 
  +
  +    /**
  +     * Sets the line number of the tag
        */
       public void setLineNumber(int lineNumber) {
           this.lineNumber = lineNumber;
       }
   
  -    /** 
  -     * @return the column number of the tag 
  +    /**
  +     * @return the column number of the tag
        */
       public int getColumnNumber() {
           return columnNumber;
       }
  -    
  -    /** 
  -     * Sets the column number of the tag 
  +
  +    /**
  +     * Sets the column number of the tag
        */
       public void setColumnNumber(int columnNumber) {
           this.columnNumber = columnNumber;
  @@ -412,7 +412,7 @@
        * Returns the namespace context of this tag. This is all the prefixes
        * in scope in the document where this tag is used which are mapped to
        * their namespace URIs.
  -     * 
  +     *
        * @return a Map with the keys are namespace prefixes and the values are
        * namespace URIs.
        */
  @@ -437,15 +437,15 @@
           }
           return namespaceContext;
       }
  -    
  +
       // Implementation methods
  -    //-------------------------------------------------------------------------      
  +    //-------------------------------------------------------------------------
   
       /**
  -     * Factory method to create a new Tag instance. 
  +     * Factory method to create a new Tag instance.
        * The default implementation is to delegate to the TagFactory
        */
  -    protected Tag createTag() throws JellyException {    
  +    protected Tag createTag() throws JellyException {
           if ( tagFactory != null) {
               return tagFactory.createTag(localName, getSaxAttributes());
           }
  @@ -466,7 +466,7 @@
           }
           tag.setParent( parentTag );
           tag.setBody( tagBody );
  -        
  +
           if (tag instanceof NamespaceAwareTag) {
               NamespaceAwareTag naTag = (NamespaceAwareTag) tag;
               naTag.setNamespaceContext(getNamespaceContext());
  @@ -475,15 +475,15 @@
               applyLocation((LocationAware) tag);
           }
       }
  -     
  +
       /**
        * Flushes the current cached tag so that it will be created, lazily, next invocation
        */
       protected void clearTag() {
           tagHolder.set(null);
       }
  -    
  -    /** 
  +
  +    /**
        * Allows the script to set the tag instance to be used, such as in a StaticTagScript
        * when a StaticTag is switched with a DynamicTag
        */
  @@ -493,7 +493,7 @@
   
       /**
        * Output the new namespace prefixes used for this element
  -     */    
  +     */
       protected void startNamespacePrefixes(XMLOutput output) throws SAXException {
           if ( tagNamespacesMap != null ) {
               for ( Iterator iter = tagNamespacesMap.entrySet().iterator(); iter.hasNext(); ) {
  @@ -504,10 +504,10 @@
               }
           }
       }
  -    
  +
       /**
        * End the new namespace prefixes mapped for the current element
  -     */    
  +     */
       protected void endNamespacePrefixes(XMLOutput output) throws SAXException {
           if ( tagNamespacesMap != null ) {
               for ( Iterator iter = tagNamespacesMap.keySet().iterator(); iter.hasNext(); ) {
  @@ -516,9 +516,9 @@
               }
           }
       }
  -    
  -    /** 
  -     * Converts the given value to the required type. 
  +
  +    /**
  +     * Converts the given value to the required type.
        *
        * @param value is the value to be converted. This will not be null
        * @param requiredType the type that the value should be converted to
  @@ -533,16 +533,16 @@
           }
           return value;
       }
  -    
  +
       /**
        * Creates a new Jelly exception, adorning it with location information
        */
       protected JellyException createJellyException(String reason) {
  -        return new JellyException( 
  +        return new JellyException(
               reason, fileName, elementName, columnNumber, lineNumber
           );
       }
  -    
  +
       /**
        * Creates a new Jelly exception, adorning it with location information
        */
  @@ -560,7 +560,7 @@
                   columnNumber,
                   lineNumber);
           }
  -        return new JellyException( 
  +        return new JellyException(
               reason, cause, fileName, elementName, columnNumber, lineNumber
           );
       }
  @@ -576,10 +576,10 @@
           }
   
           applyLocation(e);
  -        
  +
           throw e;
       }
  -    
  +
       /**
        * A helper method to handle this Jelly exception.
        * This method adorns the JellyException with location information
  @@ -591,10 +591,10 @@
           }
   
           applyLocation(e);
  -        
  +
           throw new JellyTagException(e);
       }
  -    
  +
       protected void applyLocation(LocationAware locationAware) {
           if (locationAware.getLineNumber() == -1) {
               locationAware.setColumnNumber(columnNumber);
  @@ -607,7 +607,7 @@
               locationAware.setElementName( elementName );
           }
       }
  -    
  +
       /**
        * A helper method to handle this non-Jelly exception.
        * This method will rethrow the exception, wrapped in a JellyException
  @@ -636,7 +636,7 @@
   
           throw new JellyTagException(e, fileName, elementName, columnNumber, lineNumber);
       }
  -    
  +
       /**
        * A helper method to handle this non-Jelly exception.
        * This method will rethrow the exception, wrapped in a JellyException
  
  
  
  1.17      +13 -13    jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/TextScript.java
  
  Index: TextScript.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/TextScript.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- TextScript.java	24 Feb 2004 14:03:06 -0000	1.16
  +++ TextScript.java	9 Sep 2004 12:26:22 -0000	1.17
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -28,10 +28,10 @@
     * @version $Revision$
     */
   public class TextScript implements Script {
  - 
  +
       /** the text output by this script */
       private String text;
  - 
  +
       public TextScript() {
       }
   
  @@ -42,30 +42,30 @@
       public String toString() {
           return super.toString() + "[text=" + text + "]";
       }
  -    
  +
       /**
        * Trims whitespace from the start and end of the text in this script
        */
       public void trimWhitespace() {
           this.text = text.trim();
       }
  -    
  +
       /**
        * Trims whitespace from the start of the text
        */
       public void trimStartWhitespace() {
  -        int index = 0;        
  +        int index = 0;
           for ( int length = text.length(); index < length; index++ ) {
               char ch = text.charAt(index);
               if (!Character.isWhitespace(ch)) {
                   break;
  -            }            
  +            }
           }
           if ( index > 0 ) {
               this.text = text.substring(index);
           }
       }
  -    
  +
       /**
        * Trims whitespace from the end of the text
        */
  @@ -92,9 +92,9 @@
       public void setText(String text) {
           this.text = text;
       }
  - 
  +
       // Script interface
  -    //-------------------------------------------------------------------------                
  +    //-------------------------------------------------------------------------
       public Script compile() {
           return this;
       }
  
  
  
  1.15      +9 -9      jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/ScriptBlock.java
  
  Index: ScriptBlock.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/ScriptBlock.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ScriptBlock.java	24 Feb 2004 14:03:06 -0000	1.14
  +++ ScriptBlock.java	9 Sep 2004 12:26:22 -0000	1.15
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -46,13 +46,13 @@
       public void addScript(Script script) {
           list.add(script);
       }
  -    
  +
       /** Removes a script from this block */
       public void removeScript(Script script) {
           list.remove(script);
       }
   
  -    /** 
  +    /**
        * Gets the child scripts that make up this block. This list is live
        * so that it can be modified if requried
        */
  @@ -61,7 +61,7 @@
       }
   
       // Script interface
  -    //-------------------------------------------------------------------------                    
  +    //-------------------------------------------------------------------------
       public Script compile() throws JellyException {
           int size = list.size();
           if (size == 1) {
  @@ -78,12 +78,12 @@
   
       /** Evaluates the body of a tag */
       public void run(JellyContext context, XMLOutput output) throws JellyTagException {
  -/*        
  +/*
           for (int i = 0, size = scripts.length; i < size; i++) {
               Script script = scripts[i];
               script.run(context, output);
           }
  -*/    
  +*/
           for (Iterator iter = list.iterator(); iter.hasNext(); ) {
               Script script = (Script) iter.next();
               script.run(context, output);
  
  
  
  1.12      +23 -23    jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/DynamicDynaBeanTag.java
  
  Index: DynamicDynaBeanTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/DynamicDynaBeanTag.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- DynamicDynaBeanTag.java	24 Feb 2004 14:03:06 -0000	1.11
  +++ DynamicDynaBeanTag.java	9 Sep 2004 12:26:22 -0000	1.12
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -27,9 +27,9 @@
   import org.apache.commons.jelly.XMLOutput;
   import org.apache.commons.jelly.expression.Expression;
   
  -/** 
  - * This tag is bound onto a {@link DynaClass} instance. 
  - * When the tag is invoked a {@link DynaBean will be created using the tags attributes. 
  +/**
  + * This tag is bound onto a {@link DynaClass} instance.
  + * When the tag is invoked a {@link DynaBean will be created using the tags attributes.
    * So this class is like a {@link DynaBean} implemenation of {@link DynamicBeanTag}
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  @@ -39,9 +39,9 @@
   
       /** the bean class */
       private DynaClass beanClass;
  -    
  -    /** 
  -     * the tag attribute name that is used to declare the name 
  +
  +    /**
  +     * the tag attribute name that is used to declare the name
        * of the variable to export after running this tag
        */
       private String variableNameAttribute;
  @@ -53,8 +53,8 @@
       private Set setAttributesSet = new HashSet();
   
       /** the attribute definitions */
  -    private Map attributes;    
  -        
  +    private Map attributes;
  +
       public DynamicDynaBeanTag(DynaClass beanClass, Map attributes, String variableNameAttribute) {
           this.beanClass = beanClass;
           this.attributes = attributes;
  @@ -71,10 +71,10 @@
               throw new JellyTagException("Could not instantiate dynabean",e);
           }
   
  -        setAttributesSet.clear();                    
  +        setAttributesSet.clear();
       }
   
  -    public void setAttribute(String name, Object value) throws JellyTagException {        
  +    public void setAttribute(String name, Object value) throws JellyTagException {
           boolean isVariableName = false;
           if (variableNameAttribute != null ) {
               if ( variableNameAttribute.equals( name ) ) {
  @@ -88,23 +88,23 @@
               }
           }
           if (! isVariableName) {
  -            
  +
               // #### strictly speaking we could
               // know what attributes are specified at compile time
  -            // so this dynamic set is unnecessary            
  +            // so this dynamic set is unnecessary
               setAttributesSet.add(name);
  -            
  +
               // we could maybe implement attribute specific validation here
  -            
  +
               super.setAttribute(name, value);
           }
       }
   
       // Tag interface
  -    //-------------------------------------------------------------------------                    
  +    //-------------------------------------------------------------------------
       public void doTag(XMLOutput output) throws JellyTagException {
   
  -        // lets find any attributes that are not set and 
  +        // lets find any attributes that are not set and
           for ( Iterator iter = attributes.values().iterator(); iter.hasNext(); ) {
               Attribute attribute = (Attribute) iter.next();
               String name = attribute.getName();
  @@ -118,7 +118,7 @@
                   if ( expression != null ) {
                       value = expression.evaluate(context);
                   }
  -                
  +
                   // only set non-null values?
                   if ( value != null ) {
                       super.setAttribute(name, value);
  @@ -133,11 +133,11 @@
               context.setVariable(var, getDynaBean());
           }
       }
  -    
  +
       // Properties
  -    //-------------------------------------------------------------------------                    
  +    //-------------------------------------------------------------------------
       /**
  -     * @return the bean that has just been created 
  +     * @return the bean that has just been created
        */
       public Object getBean() {
           return getDynaBean();
  
  
  
  1.5       +5 -5      jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/TagLibraryResolver.java
  
  Index: TagLibraryResolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/TagLibraryResolver.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TagLibraryResolver.java	24 Feb 2004 14:03:06 -0000	1.4
  +++ TagLibraryResolver.java	9 Sep 2004 12:26:22 -0000	1.5
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -19,7 +19,7 @@
   
   
   /**
  - * <p><code>TagLibraryResolver</code> represents an object capable of 
  + * <p><code>TagLibraryResolver</code> represents an object capable of
    * resolving a URI to a TagLibrary instance.</p>
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  @@ -31,6 +31,6 @@
        * Attempts to resolve the given URI to be associated with a TagLibrary
        * otherwise null is returned to indicate no tag library could be found
        * so that the namespace URI should be treated as just vanilla XML.
  -     */    
  +     */
       public TagLibrary resolveTagLibrary(String uri);
   }
  
  
  
  1.7       +10 -10    jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/DefaultTagFactory.java
  
  Index: DefaultTagFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/DefaultTagFactory.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultTagFactory.java	24 Feb 2004 14:03:06 -0000	1.6
  +++ DefaultTagFactory.java	9 Sep 2004 12:26:22 -0000	1.7
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -20,17 +20,17 @@
   
   import org.xml.sax.Attributes;
   
  -/** 
  +/**
    * <p><code>DefaultTagFactory</code> a default implementation of TagFactory
    * which creates new instances of a given class.
  - * 
  + *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
    * @version $Revision$
    */
   public class DefaultTagFactory implements TagFactory {
   
       private Class tagClass;
  -        
  +
       public DefaultTagFactory() {
       }
   
  @@ -39,7 +39,7 @@
       }
   
       // TagFactory interface
  -    //-------------------------------------------------------------------------      
  +    //-------------------------------------------------------------------------
       public Tag createTag(String name, Attributes attributes) throws JellyException {
           try {
             return (Tag) tagClass.newInstance();
  @@ -50,10 +50,10 @@
           }
       }
   
  -    
  +
       // Properties
  -    //-------------------------------------------------------------------------      
  -    
  +    //-------------------------------------------------------------------------
  +
       /**
        * Returns the tagClass.
        * @return Class
  
  
  
  1.23      +19 -19    jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/StaticTagScript.java
  
  Index: StaticTagScript.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/StaticTagScript.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- StaticTagScript.java	12 Aug 2004 03:51:48 -0000	1.22
  +++ StaticTagScript.java	9 Sep 2004 12:26:22 -0000	1.23
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -28,7 +28,7 @@
   import org.apache.commons.jelly.expression.Expression;
   import org.xml.sax.SAXException;
   
  -/** 
  +/**
    * <p><code>StaticTagScript</code> is a script that evaluates a StaticTag, a piece of static XML
    * though its attributes or element content may contain dynamic expressions.
    * The first time this tag evaluates, it may have become a dynamic tag, so it will check that
  @@ -45,10 +45,10 @@
       public StaticTagScript(TagFactory tagFactory) {
           super(tagFactory);
       }
  -    
  +
   
       // Script interface
  -    //-------------------------------------------------------------------------                
  +    //-------------------------------------------------------------------------
       public void run(JellyContext context, XMLOutput output) throws JellyTagException {
   
           try {
  @@ -56,35 +56,35 @@
           } catch (SAXException e) {
               throw new JellyTagException("could not start namespace prefixes",e);
           }
  -            
  +
           Tag tag = null;
           try {
  -            tag = getTag();                
  -        
  +            tag = getTag();
  +
               // lets see if we have a dynamic tag
               if (tag instanceof StaticTag) {
                   tag = findDynamicTag(context, (StaticTag) tag);
  -            }            
  -        
  +            }
  +
               setTag(tag);
           } catch (JellyException e) {
               throw new JellyTagException(e);
           }
  -        
  -        try {        
  +
  +        try {
               if ( tag == null ) {
                   return;
               }
               tag.setContext(context);
  -            
  +
               DynaTag dynaTag = (DynaTag) tag;
  -    
  +
               // ### probably compiling this to 2 arrays might be quicker and smaller
               for (Iterator iter = attributes.entrySet().iterator(); iter.hasNext();) {
                   Map.Entry entry = (Map.Entry) iter.next();
                   String name = (String) entry.getKey();
                   Expression expression = (Expression) entry.getValue();
  -    
  +
                   Object value = null;
   
                   if ( Expression.class.isAssignableFrom( dynaTag.getAttributeType(name) ) ) {
  @@ -95,7 +95,7 @@
   
                   dynaTag.setAttribute(name, value);
               }
  -        
  +
               tag.doTag(output);
           }
           catch (JellyTagException e) {
  @@ -104,7 +104,7 @@
           catch (RuntimeException e) {
               handleException(e);
           }
  -        
  +
           try {
               endNamespacePrefixes(output);
           } catch (SAXException e) {
  @@ -115,7 +115,7 @@
       /**
        * Attempts to find a dynamically created tag that has been created since this
        * script was compiled
  -     */    
  +     */
       protected Tag findDynamicTag(JellyContext context, StaticTag tag) throws JellyException {
           // lets see if there's a tag library for this URI...
           TagLibrary taglib = context.getTagLibrary( tag.getUri() );
  
  
  
  1.8       +30 -30    jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/DefaultTagLibraryResolver.java
  
  Index: DefaultTagLibraryResolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/DefaultTagLibraryResolver.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DefaultTagLibraryResolver.java	24 Feb 2004 14:03:06 -0000	1.7
  +++ DefaultTagLibraryResolver.java	9 Sep 2004 12:26:22 -0000	1.8
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -27,7 +27,7 @@
   /**
    * <p><code>DefaultTagLibraryResolver</code> is a default implemenation
    * which attempts to interpret the URI as a String called 'jelly:className'
  - * and class load the given Java class. Otherwise META-INF/services/jelly/uri 
  + * and class load the given Java class. Otherwise META-INF/services/jelly/uri
    * is searched for on the thread context's class path and, if found, that
    * class will be loaded.</p>
    *
  @@ -40,7 +40,7 @@
       private static final Log log = LogFactory.getLog(DefaultTagLibraryResolver.class);
   
       private DiscoverClasses discovery;
  -    
  +
       /**
        * The class loader to use for instantiating application objects.
        * If not specified, the context class loader, or the class loader
  @@ -54,50 +54,50 @@
        * for instantiating new objects?  Default is <code>false</code>.
        */
       private boolean useContextClassLoader = false;
  -    
  -    
  +
  +
       public DefaultTagLibraryResolver() {
       }
   
  -    
  +
       // TagLibraryResolver interface
  -    //-------------------------------------------------------------------------                
  -    
  +    //-------------------------------------------------------------------------
  +
       /**
        * Attempts to resolve the given URI to be associated with a TagLibrary
        * otherwise null is returned to indicate no tag library could be found
        * so that the namespace URI should be treated as just vanilla XML.
  -     */    
  +     */
       public TagLibrary resolveTagLibrary(String uri) {
           DiscoverClasses discovery = getDiscoverClasses();
           String name = uri;
           if ( uri.startsWith( "jelly:" ) ) {
               name = "jelly." + uri.substring(6);
           }
  -        
  +
           log.info( "Looking up service name: " + name );
   
  -/*        
  +/*
           ClassLoaders loaders = ClassLoaders.getAppLoaders(TagLibrary.class, getClass(), false);
  -        
  +
           DiscoverClass discover = new DiscoverClass(loaders);
           Class implClass = discover.find(TestInterface2.class);
   
   
   
           TagLibrary answer = null;
  -        try {                
  +        try {
               answer = (TagLibrary) DiscoverSingleton.find(TagLibrary.class, name);
           }
           catch (Exception e) {
               log.error( "Could not load service: " + name );
           }
           return answer;
  -*/        
  +*/
           ResourceClassIterator iter = discovery.findResourceClasses(name);
           while (iter.hasNext()) {
               ResourceClass resource = iter.nextResourceClass();
  -            try {                
  +            try {
                   Class typeClass = resource.loadClass();
                   if ( typeClass != null ) {
                       return newInstance(uri, typeClass);
  @@ -110,10 +110,10 @@
           log.info( "Could not find any services for name: " + name );
           return null;
       }
  -    
  +
       // Properties
  -    //-------------------------------------------------------------------------                
  -    
  +    //-------------------------------------------------------------------------
  +
       /**
        * Return the class loader to be used for instantiating application objects
        * when required.  This is determined based upon the following rules:
  @@ -136,7 +136,7 @@
           }
           return (this.getClass().getClassLoader());
       }
  -    
  +
       /**
        * Set the class loader to be used for instantiating application objects
        * when required.
  @@ -147,7 +147,7 @@
       public void setClassLoader(ClassLoader classLoader) {
           this.classLoader = classLoader;
       }
  -    
  +
       /**
        * Return the boolean as to whether the context classloader should be used.
        */
  @@ -179,20 +179,20 @@
           }
           return discovery;
       }
  -    
  +
       /**
  -     * Sets the fully configured DiscoverClasses instance to be used to 
  +     * Sets the fully configured DiscoverClasses instance to be used to
        * lookup services
        */
       public void setDiscoverClasses(DiscoverClasses discovery) {
           this.discovery = discovery;
       }
  -    
  +
       // Implementation methods
  -    //-------------------------------------------------------------------------                
  +    //-------------------------------------------------------------------------
   
       /**
  -     * Instantiates the given class name. Otherwise an exception is logged 
  +     * Instantiates the given class name. Otherwise an exception is logged
        * and null is returned
        */
       protected TagLibrary loadClass(String uri, String className) {
  @@ -207,7 +207,7 @@
           }
           return null;
       }
  -            
  +
   
       /**
        * Creates a new instance of the given TagLibrary class or
  @@ -218,7 +218,7 @@
               Object object = theClass.newInstance();
               if (object instanceof TagLibrary) {
                   return (TagLibrary) object;
  -            }                
  +            }
               else {
                   log.error(
                       "The tag library object mapped to: "
  @@ -234,5 +234,5 @@
           }
           return null;
       }
  -    
  +
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message