You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by jm...@apache.org on 2004/02/05 04:16:31 UTC

cvs commit: jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources Message.java MessageList.java Messages.java ResourcesFactory.java ResourcesFactoryFinder.java

jmitchell    2004/02/04 19:16:31

  Modified:    resources/src/java/org/apache/commons/resources/impl
                        BasicMessageList.java CollectionResourcesBase.java
                        PropertyResources.java
                        PropertyResourcesFactory.java
                        ResourceBundleResources.java
                        ResourceBundleResourcesFactory.java
                        ResourcesBase.java WebappPropertyResources.java
                        WebappPropertyResourcesFactory.java
                        WebappXMLResources.java
                        WebappXMLResourcesFactory.java XMLResources.java
                        XMLResourcesFactory.java
               resources/src/test/org/apache/commons/resources/impl
                        CollResources.java CollResourcesFactory.java
                        TestResources.java TestResourcesFactory.java
               resources/src/java/org/apache/commons/resources Message.java
                        MessageList.java Messages.java
                        ResourcesFactory.java ResourcesFactoryFinder.java
  Log:
  Fixes for:
   - change local variable names if overriding (hiding) class level
   - fix javadoc package @link references
   - general javadoc updates
  
  Revision  Changes    Path
  1.11      +9 -9      jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/BasicMessageList.java
  
  Index: BasicMessageList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/BasicMessageList.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- BasicMessageList.java	13 Oct 2003 08:22:26 -0000	1.10
  +++ BasicMessageList.java	5 Feb 2004 03:16:30 -0000	1.11
  @@ -199,14 +199,14 @@
   
   
       // See interface for JavaDoc
  -    public void add(MessageList messages) {
  +    public void add(MessageList messageList) {
           // loop over properties
  -        Iterator props = messages.properties();
  +        Iterator props = messageList.properties();
           while (props.hasNext()) {
               String property = (String) props.next();
   
               // loop over messages for each property
  -            Iterator msgs = messages.get(property);
  +            Iterator msgs = messageList.get(property);
               while (msgs.hasNext()) {
                   Message msg = (Message) msgs.next();
                   this.add(property, msg);
  @@ -252,8 +252,8 @@
           for (Iterator i = actionItems.iterator(); i.hasNext();) {
               MessageItem ami = (MessageItem) i.next();
   
  -            for (Iterator messages = ami.getList().iterator(); messages.hasNext();) {
  -                results.add(messages.next());
  +            for (Iterator msgs = ami.getList().iterator(); msgs.hasNext();) {
  +                results.add(msgs.next());
               }
           }
   
  
  
  
  1.10      +16 -12    jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/CollectionResourcesBase.java
  
  Index: CollectionResourcesBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/CollectionResourcesBase.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CollectionResourcesBase.java	13 Oct 2003 08:22:26 -0000	1.9
  +++ CollectionResourcesBase.java	5 Feb 2004 03:16:30 -0000	1.10
  @@ -76,7 +76,8 @@
   
   
   /**
  - * <p>Abstract base classes for {@link Resources} implementations that
  + * <p>Abstract base classes for 
  + * {@link org.apache.commons.resources.Resources} implementations that
    * store their name-value mappings for each supported <code>Locale</code>
    * in a URL-accessible resource file with a common base URL.  Subclasses
    * need only override <code>loadLocale()</code> to manage the details of
  @@ -96,12 +97,12 @@
   
   
       /**
  -     * <p>Create a new {@link Resources} instance with the specified
  +     * <p>Create a new {@link org.apache.commons.resources.Resources} instance with the specified
        * logical name and base URL.</p>
        *
        * @param name Logical name of the new instance
        * @param base Base URL of the resource files that contain the per-Locale
  -     *  name-value mappings for this {@link Resources} instance
  +     *  name-value mappings for this {@link org.apache.commons.resources.Resources} instance
        */
       public CollectionResourcesBase(String name, String base) {
   
  @@ -116,7 +117,7 @@
   
       /**
        * <p>The base URL for the per-Locale resources files containing the
  -     * name-value mappings for this {@link Resources} instance.</p>
  +     * name-value mappings for this {@link org.apache.commons.resources.Resources} instance.</p>
        */
       protected String base = null;
   
  @@ -146,6 +147,9 @@
       // ------------------------------------------------------------- Properties
   
   
  +    /* (non-Javadoc)
  +     * @see org.apache.commons.resources.impl.ResourcesBase#getKeys()
  +     */
       public Iterator getKeys() {
   
           synchronized (maps) {
  @@ -257,7 +261,7 @@
        * </ul>
        *
        * <p>The search order calculated by this method makes it easy for
  -     * {@link Resources} implementations to implement hierarchical search
  +     * {@link org.apache.commons.resources.Resources} implementations to implement hierarchical search
        * strategies similar to that employed by the standard Java class
        * <code>java.util.ResourceBundle</code>.</p>
        *
  @@ -345,12 +349,12 @@
        * always attempt to retrieve the specified resource and load it
        * appropriately.</p>
        *
  -     * @param base Base URL of the resource files for this {@link Resources}
  -     *  instance
  +     * @param baseUrl Base URL of the resource files for this 
  +     * {@link org.apache.commons.resources.Resources} instance
        * @param locale <code>Locale</code> for which name-value mappings
        *  are requested
        */
  -    protected abstract Map getLocaleMap(String base, Locale locale);
  +    protected abstract Map getLocaleMap(String baseUrl, Locale locale);
   
   
       /**
  
  
  
  1.9       +16 -14    jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/PropertyResources.java
  
  Index: PropertyResources.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/PropertyResources.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PropertyResources.java	13 Oct 2003 08:22:26 -0000	1.8
  +++ PropertyResources.java	5 Feb 2004 03:16:30 -0000	1.9
  @@ -73,8 +73,9 @@
   import org.apache.commons.logging.LogFactory;
   
   /**
  - * <p>Concrete implementation of {@link Resources} that wraps a family
  - * (one per <code>Locale</code> of properties files that share a base URL
  + * <p>Concrete implementation of 
  + * {@link org.apache.commons.resources.Resources} that wraps a family
  + * (one per <code>Locale</code>) of properties files that share a base URL
    * and have name suffixes reflecting the <code>Locale</code> for which
    * the document's messages apply.  Resources are looked up in a hierarchy
    * of properties files in a manner identical to that performed by
  @@ -102,7 +103,8 @@
       // ----------------------------------------------------------- Constructors
   
       /**
  -     * <p>Create a new {@link Resources} instance with the specified
  +     * <p>Create a new 
  +     * {@link org.apache.commons.resources.Resources} instance with the specified
        * logical name and base resource URL.</p>
        *
        * @param name Logical name of the new instance
  @@ -134,20 +136,20 @@
        * always attempt to retrieve the specified resource and load it
        * appropriately.</p>
        *
  -     * @param base Base URL of the resource files for this {@link Resources}
  -     *  instance
  +     * @param base Base URL of the resource files for this 
  +     * {@link org.apache.commons.resources.Resources} instance
        * @param locale <code>Locale</code> for which name-value mappings
        *  are requested
        */
  -    protected Map getLocaleMap(String base, Locale locale) {
  +    protected Map getLocaleMap(String baseUrl, Locale locale) {
   
           if (log.isDebugEnabled()) {
               log.debug("Loading locale '" + locale + "' resources from base '" +
  -                      base + "'");
  +                    baseUrl + "'");
           }
   
           Properties props = new Properties();
  -        String name = base + getLocaleSuffix(locale) + ".properties";
  +        String name = baseUrl + getLocaleSuffix(locale) + ".properties";
           InputStream stream = null;
   
           try {
  @@ -170,14 +172,14 @@
               // Log and swallow this exception
               if (log.isDebugEnabled()) {
                   log.debug("No resources for locale '" + locale +
  -                          "' from base '" + base + "'");
  +                          "' from base '" + baseUrl + "'");
               }
               props.clear();
   
           } catch (IOException e) {
   
               log.warn("IOException loading locale '" + locale +
  -                     "' from base '" + base + "'", e);
  +                     "' from base '" + baseUrl + "'", e);
               props.clear();
   
           } finally {
  
  
  
  1.8       +23 -19    jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/PropertyResourcesFactory.java
  
  Index: PropertyResourcesFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/PropertyResourcesFactory.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PropertyResourcesFactory.java	13 Oct 2003 08:22:26 -0000	1.7
  +++ PropertyResourcesFactory.java	5 Feb 2004 03:16:30 -0000	1.8
  @@ -65,12 +65,14 @@
   import org.apache.commons.resources.ResourcesException;
   
   /**
  - * <p>Concrete implementation of {@link ResourcesFactory} that creates
  - * {@link Resources} instances that wrap a family (one per Locale) of
  - * properties files that share a base URL and have name suffices reflecting
  - * the Locale for which the document's messages apply.  Resources are
  - * looked up in a hierarchy of documents in a manner identical to that
  - * performed by <code>java.util.ResourceBundle.getBundle()</code>.</p>
  + * <p>Concrete implementation of 
  + * {@link org.apache.commons.resources.ResourcesFactory} that creates
  + * {@link org.apache.commons.resources.Resources} instances that wrap 
  + * a family (one per Locale) of properties files that share a base URL
  + * and have name suffices reflecting the Locale for which the document's 
  + * messages apply.  Resources are looked up in a hierarchy of documents 
  + * in a manner identical to that performed by 
  + * <code>java.util.ResourceBundle.getBundle()</code>.</p>
    *
    * <p>The configuration variable passed to the <code>createResources()</code>
    * method must be the URL of the base name of the properties file family.
  @@ -91,23 +93,25 @@
   
   
       /**
  -     * <p>Create and return a new {@link Resources} instance with the
  -     * specified logical name, after calling its <code>init()</code>
  +     * <p>Create and return a new {@link org.apache.commons.resources.Resources} 
  +     * instance with the specified logical name, after calling its <code>init()</code>
        * method and delegating the relevant properties.</p>
        *
  -     * @param name Logical name of the {@link Resources} instance to create
  +     * @param name Logical name of the {@link org.apache.commons.resources.Resources} 
  +     * instance to create
  +     * 
        * @param config Configuration string for this resource (if any)
        *
  -     * @exception ResourcesException if a {@link Resources} instance
  -     *  of the specified logical name cannot be created.
  +     * @exception ResourcesException if a {@link org.apache.commons.resources.Resources} 
  +     * instance of the specified logical name cannot be created.
        */
       protected Resources createResources(String name, String config)
           throws ResourcesException {
   
  -        Resources resources = new PropertyResources(name, config);
  -        resources.setReturnNull(isReturnNull());
  -        resources.init();
  -        return (resources);
  +        Resources res = new PropertyResources(name, config);
  +        res.setReturnNull(isReturnNull());
  +        res.init();
  +        return (res);
   
       }
   
  
  
  
  1.13      +10 -8     jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/ResourceBundleResources.java
  
  Index: ResourceBundleResources.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/ResourceBundleResources.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ResourceBundleResources.java	13 Oct 2003 08:22:26 -0000	1.12
  +++ ResourceBundleResources.java	5 Feb 2004 03:16:30 -0000	1.13
  @@ -81,7 +81,8 @@
   import org.apache.commons.resources.ResourcesKeyException;
   
   /**
  - * <p>Concrete implementation of {@link Resources} that wraps a set
  + * <p>Concrete implementation of 
  + * {@link org.apache.commons.resources.Resources} that wraps a set
    * (one per Locale) of <code>java.util.ResourceBundle</code> instances
    * that share a common base name.  The <code>timeZone</code> argument
    * is ignored in all resource getter method implementations.</p>
  @@ -101,7 +102,8 @@
   
   
       /**
  -     * <p>Create a new {@link Resources} instance with the specified
  +     * <p>Create a new {@link org.apache.commons.resources.Resources} 
  +     * instance with the specified
        * logical name and bundle base name.</p>
        *
        * @param name Logical name of the new instance
  @@ -128,7 +130,7 @@
   
       /**
        * <p>Two-level cache of <code>ResourceBundle</code> instances
  -     * that have previously been acquired by this {@link Resources}
  +     * that have previously been acquired by this {@link org.apache.commons.resources.Resources}
        * instance.  The first-level key is the <code>ClassLoader</code>
        * instance used to load the bundles.  The first-level value is a
        * <code>java.util.Map</code> that is then, in turn, keyed by the
  @@ -142,7 +144,7 @@
   
       /**
        * <p>This must be called to initialize the data content of this
  -     * {@link Resources} instance, before any of the <code>getXxx()</code>
  +     * {@link org.apache.commons.resources.Resources} instance, before any of the <code>getXxx()</code>
        * methods are called.</p>
        *
        * @exception ResourcesException if an error occurs during initialization
  
  
  
  1.11      +13 -13    jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/ResourceBundleResourcesFactory.java
  
  Index: ResourceBundleResourcesFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/ResourceBundleResourcesFactory.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ResourceBundleResourcesFactory.java	13 Oct 2003 08:22:27 -0000	1.10
  +++ ResourceBundleResourcesFactory.java	5 Feb 2004 03:16:30 -0000	1.11
  @@ -65,8 +65,8 @@
   import org.apache.commons.resources.ResourcesException;
   
   /**
  - * <p>Concrete implementation of {@link ResourcesFactory} that creates
  - * {@link Resources} instances that wrap a set (one per Locale) of
  + * <p>Concrete implementation of {@link org.apache.commons.resources.ResourcesFactory} that creates
  + * {@link org.apache.commons.resources.Resources} instances that wrap a set (one per Locale) of
    * <code>java.util.ResourceBundle</code> instances that share a common
    * base name.  The configuration String that is passed to the
    * <code>getResources()</code> method must contain the fully qualified
  @@ -87,23 +87,23 @@
   
   
       /**
  -     * <p>Create and return a new {@link Resources} instance with the
  +     * <p>Create and return a new {@link org.apache.commons.resources.Resources} instance with the
        * specified logical name, after calling its <code>init()</code>
        * method and delegating the relevant properties.</p>
        *
  -     * @param name Logical name of the {@link Resources} instance to create
  +     * @param name Logical name of the {@link org.apache.commons.resources.Resources} instance to create
        * @param config Configuration string for this resource (if any)
        *
  -     * @exception ResourcesException if a {@link Resources} instance
  +     * @exception ResourcesException if a {@link org.apache.commons.resources.Resources} instance
        *  of the specified logical name cannot be created.
        */
       protected Resources createResources(String name, String config)
           throws ResourcesException {
   
  -        Resources resources = new ResourceBundleResources(name, config);
  -        resources.setReturnNull(isReturnNull());
  -        resources.init();
  -        return (resources);
  +        Resources res = new ResourceBundleResources(name, config);
  +        res.setReturnNull(isReturnNull());
  +        res.init();
  +        return (res);
   
       }
   
  
  
  
  1.9       +18 -14    jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/ResourcesBase.java
  
  Index: ResourcesBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/ResourcesBase.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ResourcesBase.java	13 Oct 2003 08:22:27 -0000	1.8
  +++ ResourcesBase.java	5 Feb 2004 03:16:30 -0000	1.9
  @@ -73,14 +73,15 @@
   import org.apache.commons.resources.ResourcesException;
   
   /**
  - * <p>Convenience base class for {@link Resources} implementations.</p>
  + * <p>Convenience base class for 
  + * {@link org.apache.commons.resources.Resources} implementations.</p>
    *
    * <p>Default implementations of the content retrieval methods are provided
    * for all methods except <code>getObject()</code>.  The default methods for
    * the other content retrieval methods are coded in terms of
    * <code>getString()</code>, on the assumption that most uses of
  - * {@link Resources} are of this type.  However, they can be easily
  - * overridden as needed.</p>
  + * {@link org.apache.commons.resources.Resources} are of this type.  
  + * However, they can be easily overridden as needed.</p>
    *
    * @author Mike Schachter (mschachter@hp.com)
    * @author Craig R. McClanahan
  @@ -94,7 +95,8 @@
   
   
       /**
  -     * <p>Create a new {@link Resources} instance with no name.</p>
  +     * <p>Create a new {@link org.apache.commons.resources.Resources} instance 
  +     * with no name.</p>
        */
       public ResourcesBase() {
   
  @@ -104,8 +106,8 @@
   
   
       /**
  -     * <p>Create a new {@link Resources} instance with the specified
  -     * logical name.</p>
  +     * <p>Create a new {@link org.apache.commons.resources.Resources} instance 
  +     * with the specified logical name.</p>
        *
        * @param name Logical name of the new instance
        */
  @@ -120,7 +122,8 @@
   
   
       /**
  -     * <p>The logical name of this {@link Resources} instance.</p>
  +     * <p>The logical name of this {@link org.apache.commons.resources.Resources} 
  +     * instance.</p>
        */
       private String name = null;
   
  @@ -138,8 +141,8 @@
   
       /**
        * <p>This must be called to initialize the data content of this
  -     * {@link Resources} instance, before any of the <code>getXxx()</code>
  -     * methods are called.</p>
  +     * {@link org.apache.commons.resources.Resources} instance, before 
  +     * any of the <code>getXxx()</code> methods are called.</p>
        *
        * <p>The default implementation does nothing.</p>
        *
  @@ -176,7 +179,8 @@
   
   
       /**
  -     * <p>Return the logical name of this {@link Resources} instance.</p>
  +     * <p>Return the logical name of this {@link org.apache.commons.resources.Resources} 
  +     * instance.</p>
        */
       public String getName() {
   
  
  
  
  1.8       +12 -12    jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/WebappPropertyResources.java
  
  Index: WebappPropertyResources.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/WebappPropertyResources.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WebappPropertyResources.java	13 Oct 2003 08:22:27 -0000	1.7
  +++ WebappPropertyResources.java	5 Feb 2004 03:16:30 -0000	1.8
  @@ -74,7 +74,7 @@
   import org.apache.commons.logging.LogFactory;
   
   /**
  - * <p>Concrete implementation of {@link Resources} that wraps a family
  + * <p>Concrete implementation of {@link org.apache.commons.resources.Resources} that wraps a family
    * (one per <code>Locale</code> of properties files that share a base
    * context-relative path for servlet context resources, and have
    * name suffixes reflecting the <code>Locale</code> for which
  @@ -106,7 +106,7 @@
   
   
       /**
  -     * <p>Create a new {@link Resources} instance with the specified
  +     * <p>Create a new {@link org.apache.commons.resources.Resources} instance with the specified
        * logical name and base resource URL.</p>
        *
        * @param name Logical name of the new instance
  @@ -154,20 +154,20 @@
        * always attempt to retrieve the specified resource and load it
        * appropriately.</p>
        *
  -     * @param base Base URL of the resource files for this {@link Resources}
  +     * @param base Base URL of the resource files for this {@link org.apache.commons.resources.Resources}
        *  instance
        * @param locale <code>Locale</code> for which name-value mappings
        *  are requested
        */
  -    protected Map getLocaleMap(String base, Locale locale) {
  +    protected Map getLocaleMap(String baseUrl, Locale locale) {
   
           if (log.isDebugEnabled()) {
               log.debug("Loading locale '" + locale + "' resources from base '" +
  -                      base + "'");
  +                    baseUrl + "'");
           }
   
           Properties props = new Properties();
  -        String name = base + getLocaleSuffix(locale) + ".properties";
  +        String name = baseUrl + getLocaleSuffix(locale) + ".properties";
           InputStream stream = null;
   
           try {
  @@ -191,14 +191,14 @@
               // Log and swallow this exception
               if (log.isDebugEnabled()) {
                   log.debug("No resources for locale '" + locale +
  -                          "' from base '" + base + "'");
  +                          "' from base '" + baseUrl + "'");
               }
               props.clear();
   
           } catch (IOException e) {
   
               log.warn("IOException loading locale '" + locale +
  -                     "' from base '" + base + "'", e);
  +                     "' from base '" + baseUrl + "'", e);
               props.clear();
   
           } finally {
  
  
  
  1.8       +13 -13    jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/WebappPropertyResourcesFactory.java
  
  Index: WebappPropertyResourcesFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/WebappPropertyResourcesFactory.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WebappPropertyResourcesFactory.java	13 Oct 2003 08:22:27 -0000	1.7
  +++ WebappPropertyResourcesFactory.java	5 Feb 2004 03:16:30 -0000	1.8
  @@ -67,8 +67,8 @@
   import org.apache.commons.resources.ResourcesException;
   
   /**
  - * <p>Concrete implementation of {@link ResourcesFactory} that creates
  - * {@link Resources} instances that wrap a family (one per Locale) of
  + * <p>Concrete implementation of {@link org.apache.commons.resources.ResourcesFactory} that creates
  + * {@link org.apache.commons.resources.Resources} instances that wrap a family (one per Locale) of
    * property files that share a base context-relative path for
    * servlet context resources, and have name suffixes reflecting
    * the Locale for which the file's messages apply.  Resources are
  @@ -131,24 +131,24 @@
   
   
       /**
  -     * <p>Create and return a new {@link Resources} instance with the
  +     * <p>Create and return a new {@link org.apache.commons.resources.Resources} instance with the
        * specified logical name, after calling its <code>init()</code>
        * method and delegating the relevant properties.</p>
        *
  -     * @param name Logical name of the {@link Resources} instance to create
  +     * @param name Logical name of the {@link org.apache.commons.resources.Resources} instance to create
        * @param config Configuration string for this resource (if any)
        *
  -     * @exception ResourcesException if a {@link Resources} instance
  +     * @exception ResourcesException if a {@link org.apache.commons.resources.Resources} instance
        *  of the specified logical name cannot be created.
        */
       protected Resources createResources(String name, String config)
           throws ResourcesException {
   
  -        Resources resources =
  +        Resources res =
               new WebappPropertyResources(name, config, servletContext);
  -        resources.setReturnNull(isReturnNull());
  -        resources.init();
  -        return (resources);
  +        res.setReturnNull(isReturnNull());
  +        res.init();
  +        return (res);
   
       }
   
  
  
  
  1.8       +14 -13    jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/WebappXMLResources.java
  
  Index: WebappXMLResources.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/WebappXMLResources.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WebappXMLResources.java	13 Oct 2003 08:22:27 -0000	1.7
  +++ WebappXMLResources.java	5 Feb 2004 03:16:30 -0000	1.8
  @@ -76,7 +76,8 @@
   import org.xml.sax.SAXException;
   
   /**
  - * <p>Concrete implementation of {@link Resources} that wraps a family
  + * <p>Concrete implementation of 
  + * {@link org.apache.commons.resources.Resources} that wraps a family
    * (one per <code>Locale</code> of XML documents that share a base
    * context-relative path for servlet context resources, and have
    * name suffixes reflecting the <code>Locale</code> for which
  @@ -108,7 +109,7 @@
   
   
       /**
  -     * <p>Create a new {@link Resources} instance with the specified
  +     * <p>Create a new {@link org.apache.commons.resources.Resources} instance with the specified
        * logical name and base resource URL.</p>
        *
        * @param name Logical name of the new instance
  @@ -155,20 +156,20 @@
        * always attempt to retrieve the specified resource and load it
        * appropriately.</p>
        *
  -     * @param base Base URL of the resource files for this {@link Resources}
  +     * @param baseUrl Base URL of the resource files for this {@link org.apache.commons.resources.Resources}
        *  instance
        * @param locale <code>Locale</code> for which name-value mappings
        *  are requested
        */
  -    protected Map getLocaleMap(String base, Locale locale) {
  +    protected Map getLocaleMap(String baseUrl, Locale locale) {
   
           if (log.isDebugEnabled()) {
               log.debug("Loading locale '" + locale + "' resources from base '" +
  -                      base + "'");
  +                    baseUrl + "'");
           }
   
           Map map = new HashMap();
  -        String name = base + getLocaleSuffix(locale) + ".xml";
  +        String name = baseUrl + getLocaleSuffix(locale) + ".xml";
           InputStream stream = null;
   
           try {
  @@ -208,7 +209,7 @@
               // Log and swallow this exception
               if (log.isDebugEnabled()) {
                   log.debug("No resources for locale '" + locale +
  -                          "' from base '" + base + "'");
  +                          "' from base '" + baseUrl + "'");
               }
               map.clear();
   
  @@ -216,14 +217,14 @@
   
               // Log and swallow this exception
               log.warn("IOException loading locale '" + locale +
  -                     "' from base '" + base + "'", e);
  +                     "' from base '" + baseUrl + "'", e);
               map.clear();
   
           } catch (SAXException e) {
   
               // Log and swallow this exception
               log.warn("SAXException loading locale '" + locale +
  -                     "' from base '" + base + "'", e);
  +                     "' from base '" + baseUrl + "'", e);
               map.clear();
   
           } finally {
  
  
  
  1.8       +13 -13    jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/WebappXMLResourcesFactory.java
  
  Index: WebappXMLResourcesFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/WebappXMLResourcesFactory.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WebappXMLResourcesFactory.java	13 Oct 2003 08:22:27 -0000	1.7
  +++ WebappXMLResourcesFactory.java	5 Feb 2004 03:16:30 -0000	1.8
  @@ -67,8 +67,8 @@
   import org.apache.commons.resources.ResourcesException;
   
   /**
  - * <p>Concrete implementation of {@link ResourcesFactory} that creates
  - * {@link Resources} instances that wrap a family (one per Locale) of
  + * <p>Concrete implementation of {@link org.apache.commons.resources.ResourcesFactory} that creates
  + * {@link org.apache.commons.resources.Resources} instances that wrap a family (one per Locale) of
    * XML documents that share a base context-relative path for
    * servlet context resources, and have name suffixes reflecting
    * the Locale for which the document's messages apply.  Resources are
  @@ -131,24 +131,24 @@
   
   
       /**
  -     * <p>Create and return a new {@link Resources} instance with the
  +     * <p>Create and return a new {@link org.apache.commons.resources.Resources} instance with the
        * specified logical name, after calling its <code>init()</code>
        * method and delegating the relevant properties.</p>
        *
  -     * @param name Logical name of the {@link Resources} instance to create
  +     * @param name Logical name of the {@link org.apache.commons.resources.Resources} instance to create
        * @param config Configuration string for this resource (if any)
        *
  -     * @exception ResourcesException if a {@link Resources} instance
  +     * @exception ResourcesException if a {@link org.apache.commons.resources.Resources} instance
        *  of the specified logical name cannot be created.
        */
       protected Resources createResources(String name, String config)
           throws ResourcesException {
   
  -        Resources resources =
  +        Resources res =
               new WebappXMLResources(name, config, servletContext);
  -        resources.setReturnNull(isReturnNull());
  -        resources.init();
  -        return (resources);
  +        res.setReturnNull(isReturnNull());
  +        res.init();
  +        return (res);
   
       }
   
  
  
  
  1.8       +14 -13    jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/XMLResources.java
  
  Index: XMLResources.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/XMLResources.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLResources.java	13 Oct 2003 08:22:27 -0000	1.7
  +++ XMLResources.java	5 Feb 2004 03:16:30 -0000	1.8
  @@ -75,7 +75,8 @@
   import org.xml.sax.SAXException;
   
   /**
  - * <p>Concrete implementation of {@link Resources} that wraps a family
  + * <p>Concrete implementation of 
  + * {@link org.apache.commons.resources.Resources} that wraps a family
    * (one per <code>Locale</code> of XML documents that share a base URL
    * and have name suffixes reflecting the <code>Locale</code> for which
    * the document's messages apply.  Resources are looked up in a hierarchy
  @@ -115,7 +116,7 @@
   
   
       /**
  -     * <p>Create a new {@link Resources} instance with the specified
  +     * <p>Create a new {@link org.apache.commons.resources.Resources} instance with the specified
        * logical name and base resource URL.</p>
        *
        * @param name Logical name of the new instance
  @@ -147,20 +148,20 @@
        * always attempt to retrieve the specified resource and load it
        * appropriately.</p>
        *
  -     * @param base Base URL of the resource files for this {@link Resources}
  +     * @param baseUrl Base URL of the resource files for this {@link org.apache.commons.resources.Resources}
        *  instance
        * @param locale <code>Locale</code> for which name-value mappings
        *  are requested
        */
  -    protected Map getLocaleMap(String base, Locale locale) {
  +    protected Map getLocaleMap(String baseUrl, Locale locale) {
   
           if (log.isDebugEnabled()) {
               log.debug("Loading locale '" + locale + "' resources from base '" +
  -                      base + "'");
  +                    baseUrl + "'");
           }
   
           Map map = new HashMap();
  -        String name = base + getLocaleSuffix(locale) + ".xml";
  +        String name = baseUrl + getLocaleSuffix(locale) + ".xml";
           InputStream stream = null;
   
           try {
  @@ -197,7 +198,7 @@
               // Log and swallow this exception
               if (log.isDebugEnabled()) {
                   log.debug("No resources for locale '" + locale +
  -                          "' from base '" + base + "'");
  +                          "' from base '" + baseUrl + "'");
               }
               map.clear();
   
  @@ -205,14 +206,14 @@
   
               // Log and swallow this exception
               log.warn("IOException loading locale '" + locale +
  -                     "' from base '" + base + "'", e);
  +                     "' from base '" + baseUrl + "'", e);
               map.clear();
   
           } catch (SAXException e) {
   
               // Log and swallow this exception
               log.warn("SAXException loading locale '" + locale +
  -                     "' from base '" + base + "'", e);
  +                     "' from base '" + baseUrl + "'", e);
               map.clear();
   
           } finally {
  
  
  
  1.8       +13 -13    jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/XMLResourcesFactory.java
  
  Index: XMLResourcesFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/impl/XMLResourcesFactory.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLResourcesFactory.java	13 Oct 2003 08:22:27 -0000	1.7
  +++ XMLResourcesFactory.java	5 Feb 2004 03:16:30 -0000	1.8
  @@ -65,8 +65,8 @@
   import org.apache.commons.resources.ResourcesException;
   
   /**
  - * <p>Concrete implementation of {@link ResourcesFactory} that creates
  - * {@link Resources} instances that wrap a family (one per Locale) of
  + * <p>Concrete implementation of {@link org.apache.commons.resources.ResourcesFactory} that creates
  + * {@link org.apache.commons.resources.Resources} instances that wrap a family (one per Locale) of
    * XML documents that share a base URL and have name suffices reflecting
    * the Locale for which the document's messages apply.  Resources are
    * looked up in a hierarchy of documents in a manner identical to that
  @@ -91,23 +91,23 @@
   
   
       /**
  -     * <p>Create and return a new {@link Resources} instance with the
  +     * <p>Create and return a new {@link org.apache.commons.resources.Resources} instance with the
        * specified logical name, after calling its <code>init()</code>
        * method and delegating the relevant properties.</p>
        *
  -     * @param name Logical name of the {@link Resources} instance to create
  +     * @param name Logical name of the {@link org.apache.commons.resources.Resources} instance to create
        * @param config Configuration string for this resource (if any)
        *
  -     * @exception ResourcesException if a {@link Resources} instance
  +     * @exception ResourcesException if a {@link org.apache.commons.resources.Resources} instance
        *  of the specified logical name cannot be created.
        */
       protected Resources createResources(String name, String config)
           throws ResourcesException {
   
  -        Resources resources = new XMLResources(name, config);
  -        resources.setReturnNull(isReturnNull());
  -        resources.init();
  -        return (resources);
  +        Resources res = new XMLResources(name, config);
  +        res.setReturnNull(isReturnNull());
  +        res.init();
  +        return (res);
   
       }
   
  
  
  
  1.5       +6 -6      jakarta-commons-sandbox/resources/src/test/org/apache/commons/resources/impl/CollResources.java
  
  Index: CollResources.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/test/org/apache/commons/resources/impl/CollResources.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CollResources.java	13 Oct 2003 08:21:17 -0000	1.4
  +++ CollResources.java	5 Feb 2004 03:16:31 -0000	1.5
  @@ -66,7 +66,7 @@
   import java.util.Map;
   
   /**
  - * <p>Concrete implementation of {@link Resources} for unit tests.</p>
  + * <p>Concrete implementation of {@link org.apache.commons.resources.Resources} for unit tests.</p>
    *
    * <p><strong>IMPLEMENTATION NOTE</strong> - The set of hard-coded resource
    * maps returned by <code>getLocaleMap()</code> below must *exactly*
  @@ -102,7 +102,7 @@
   
   
       // Concrete implementation of getLocaleMap()
  -    protected Map getLocaleMap(String base, Locale locale) {
  +    protected Map getLocaleMap(String baseUrl, Locale locale) {
   
           String language = locale.getLanguage();
           String country = locale.getCountry();
  
  
  
  1.5       +8 -8      jakarta-commons-sandbox/resources/src/test/org/apache/commons/resources/impl/CollResourcesFactory.java
  
  Index: CollResourcesFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/test/org/apache/commons/resources/impl/CollResourcesFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CollResourcesFactory.java	13 Oct 2003 08:21:17 -0000	1.4
  +++ CollResourcesFactory.java	5 Feb 2004 03:16:31 -0000	1.5
  @@ -94,10 +94,10 @@
       protected Resources createResources(String name, String config)
           throws ResourcesException {
   
  -        Resources resources = new CollResources(name, config);
  -        resources.init();
  -        resources.setReturnNull(isReturnNull());
  -        return (resources);
  +        Resources res = new CollResources(name, config);
  +        res.init();
  +        res.setReturnNull(isReturnNull());
  +        return (res);
   
       }
   
  
  
  
  1.8       +5 -5      jakarta-commons-sandbox/resources/src/test/org/apache/commons/resources/impl/TestResources.java
  
  Index: TestResources.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/test/org/apache/commons/resources/impl/TestResources.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestResources.java	13 Oct 2003 08:21:17 -0000	1.7
  +++ TestResources.java	5 Feb 2004 03:16:31 -0000	1.8
  @@ -73,7 +73,7 @@
   import org.apache.commons.resources.ResourcesKeyException;
   
   /**
  - * <p>Concrete implementation of {@link Resources} for unit tests.</p>
  + * <p>Concrete implementation of {@link org.apache.commons.resources.Resources} for unit tests.</p>
    *
    * @author Craig R. McClanahan
    * @version $Revision$ $Date$
  
  
  
  1.6       +8 -8      jakarta-commons-sandbox/resources/src/test/org/apache/commons/resources/impl/TestResourcesFactory.java
  
  Index: TestResourcesFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/test/org/apache/commons/resources/impl/TestResourcesFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestResourcesFactory.java	13 Oct 2003 08:21:17 -0000	1.5
  +++ TestResourcesFactory.java	5 Feb 2004 03:16:31 -0000	1.6
  @@ -94,10 +94,10 @@
       protected Resources createResources(String name, String config)
           throws ResourcesException {
   
  -        Resources resources = new TestResources(name);
  -        resources.init();
  -        resources.setReturnNull(isReturnNull());
  -        return (resources);
  +        Resources res = new TestResources(name);
  +        res.init();
  +        res.setReturnNull(isReturnNull());
  +        return (res);
   
       }
   
  
  
  
  1.5       +6 -6      jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/Message.java
  
  Index: Message.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/Message.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Message.java	13 Oct 2003 08:22:26 -0000	1.4
  +++ Message.java	5 Feb 2004 03:16:31 -0000	1.5
  @@ -77,12 +77,12 @@
   public interface Message {
   
       /**
  -     * Get the message key for this message.
  +     * @return Get the message key for this message.
        */
       public String getKey();
   
       /**
  -     * Get the replacement values for this message.
  +     * @return Get the replacement values for this message.
        */
       public Object[] getValues();
   
  
  
  
  1.8       +5 -5      jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/MessageList.java
  
  Index: MessageList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/MessageList.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MessageList.java	13 Oct 2003 08:22:26 -0000	1.7
  +++ MessageList.java	5 Feb 2004 03:16:31 -0000	1.8
  @@ -156,7 +156,7 @@
       public boolean isAccessed();
   
       /**
  -     * Return <code>true</code> if there are no messages recorded
  +     * @return Return <code>true</code> if there are no messages recorded
        * in this collection, or <code>false</code> otherwise.
        */
       public boolean isEmpty();
  
  
  
  1.9       +5 -5      jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/Messages.java
  
  Index: Messages.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/Messages.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Messages.java	13 Oct 2003 08:22:26 -0000	1.8
  +++ Messages.java	5 Feb 2004 03:16:31 -0000	1.9
  @@ -223,7 +223,7 @@
   
   
       /**
  -     * <p>The {@link ResourcesFactory} that will be used by the
  +     * <p>The {@link org.apache.commons.resources.ResourcesFactory} that will be used by the
        * <code>getMessages()</code> method.</p>
        */
       protected static ResourcesFactory factory = null;
  
  
  
  1.9       +36 -23    jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/ResourcesFactory.java
  
  Index: ResourcesFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/ResourcesFactory.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ResourcesFactory.java	13 Oct 2003 08:22:26 -0000	1.8
  +++ ResourcesFactory.java	5 Feb 2004 03:16:31 -0000	1.9
  @@ -64,17 +64,22 @@
   import java.io.Serializable;
   
   /**
  - * <a>A {@link ResourcesFactory} is a factory pattern interface for a
  - * class that can create {@link Resources} instances based on a logical
  + * <a>A {@link org.apache.commons.resources.ResourcesFactory} 
  + * is a factory pattern interface for a
  + * class that can create {@link org.apache.commons.resources.Resources} 
  + * instances based on a logical
    * name that is passed to the factory.  Repeated requests to return a
  - * {@link Resources} instance with the same name should return the same
  - * {@link Resources} instance each time.</p>
  + * {@link org.apache.commons.resources.Resources} instance with the same 
  + * name should return the same
  + * {@link org.apache.commons.resources.Resources} instance each time.</p>
    *
  - * <p>Implementations of {@link ResourcesFactory} <strong>MUST</strong>
  + * <p>Implementations of {@link org.apache.commons.resources.ResourcesFactory} 
  + * <strong>MUST</strong>
    * include a zero-arguments constructor so that instances of the factory
    * can be dynamically created.  Therefore, configuration information
    * above and beyond the configuration String will generally be specified
  - * via JavaBeans property setters o the {@link ResourcesFactory}
  + * via JavaBeans property setters on the 
  + * {@link org.apache.commons.resources.ResourcesFactory}
    * implementation class.</p>
    *
    * @author Mike Schachter (mschachter@hp.com)
  @@ -90,14 +95,16 @@
   
       /**
        * <p>Return the <code>returnNull</code> property value that will be
  -     * configured on {@link Resources} instances created by this factory.</p>
  +     * configured on {@link org.apache.commons.resources.Resources} 
  +     * instances created by this factory.</p>
        */
       public boolean isReturnNull();
   
   
       /**
  -     * <p>Set the <code>returnNull</code> property value that will be
  -     * configured on {@link Resources} instances created by this factory.</p>
  +     * <p>Set the <code>returnNull</code> property value that will be configured on 
  +     * {@link org.apache.commons.resources.Resources} instances created by this 
  +     * factory.</p>
        *
        * @param returnNull The new value to delegate
        */
  @@ -108,13 +115,16 @@
   
   
       /**
  -     * <p>Create (if necessary) and return a {@link Resources} instance
  +     * <p>Create (if necessary) and return a 
  +     * {@link org.apache.commons.resources.Resources} instance
        * for the specified logical name, with a default configuration.</p>
        *
  -     * @param name Logical name of the {@link Resources} instance to
  +     * @param name Logical name of the 
  +     * {@link org.apache.commons.resources.Resources} instance to
        *  be returned
        *
  -     * @exception ResourcesException if a {@link Resources} instance
  +     * @exception ResourcesException if a 
  +     * {@link org.apache.commons.resources.Resources} instance
        *  of the specified logical name cannot be returned.
        */
       public Resources getResources(String name)
  @@ -122,18 +132,20 @@
   
   
       /**
  -     * <p>Create (if necessary) and return a {@link Resources} instance
  +     * <p>Create (if necessary) and return a 
  +     * {@link org.apache.commons.resources.Resources} instance
        * for the specified logical name, with a configuration based on
        * the specified configuration String.</p>
        *
  -     * @param name Logical name of the {@link Resources} instance to
  -     *  be returned
  +     * @param name Logical name of the 
  +     * {@link org.apache.commons.resources.Resources} instance to be returned
        * @param config Configuration string for this resource (meaning
  -     *  is dependent upon the {@link ResourcesFactory} implementation
  -     *  being utilized), or <code>null</code> for the default
  +     *  is dependent upon the {@link org.apache.commons.resources.ResourcesFactory} 
  +     * implementation being utilized), or <code>null</code> for the default
        *  configuration
        *
  -     * @exception ResourcesException if a {@link Resources} instance
  +     * @exception ResourcesException if a 
  +     * {@link org.apache.commons.resources.Resources} instance
        *  of the specified logical name cannot be returned.
        */
       public Resources getResources(String name, String config)
  @@ -141,7 +153,8 @@
   
   
       /**
  -     * <p>Release any internal references to {@link Resources} instances
  +     * <p>Release any internal references to 
  +     * {@link org.apache.commons.resources.Resources} instances
        * that have been returned previously, after calling the
        * <code>destroy()</code> method of each such instance.</p>
        *
  
  
  
  1.5       +6 -6      jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/ResourcesFactoryFinder.java
  
  Index: ResourcesFactoryFinder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/ResourcesFactoryFinder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ResourcesFactoryFinder.java	13 Oct 2003 08:22:26 -0000	1.4
  +++ ResourcesFactoryFinder.java	5 Feb 2004 03:16:31 -0000	1.5
  @@ -65,7 +65,7 @@
   
   /**
    * <p>Convenience factory class for instantiating an implementation of
  - * {@link ResourcesFactory} based on the discovery features of the
  + * {@link org.apache.commons.resources.ResourcesFactory} based on the discovery features of the
    * <code>commons-discovery</code> package.</p>
    *
    * @author Craig R. McClanahan
  @@ -76,7 +76,7 @@
   
   
       /**
  -     * <p>Create and return a {@link ResourcesFactory} instance based on
  +     * <p>Create and return a {@link org.apache.commons.resources.ResourcesFactory} instance based on
        * dynamic discovery of the desired implementation class.  No
        * default implementation is specified.</p>
        *
  
  
  

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