commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1153984 - in /commons/proper/configuration/trunk/src: changes/ java/org/apache/commons/configuration/
Date Thu, 04 Aug 2011 19:57:04 GMT
Author: oheger
Date: Thu Aug  4 19:57:03 2011
New Revision: 1153984

URL: http://svn.apache.org/viewvc?rev=1153984&view=rev
Log:
[CONFIGURATION-456] Improved Javadocs of getKeys(String) method.

Modified:
    commons/proper/configuration/trunk/src/changes/changes.xml
    commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
    commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/Configuration.java
    commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java

Modified: commons/proper/configuration/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/changes/changes.xml?rev=1153984&r1=1153983&r2=1153984&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/changes/changes.xml (original)
+++ commons/proper/configuration/trunk/src/changes/changes.xml Thu Aug  4 19:57:03 2011
@@ -28,6 +28,10 @@
         clear() method. This is more efficient and also solves some other
         problems related to clearing a SubnodeConfiguration.
       </action>
+      <action dev="oheger" type="update" issue="CONFIGURATION-456">
+        Improved Javadocs of getKeys(String) method for some configuration
+        classes.
+      </action>
       <action dev="oheger" type="update" issue="CONFIGURATION-455">
         HierarchicalINIConfiguration.getSection() now creates a section if it
         does not exist. The SubnodeConfiguration returned by this method is now

Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java?rev=1153984&r1=1153983&r2=1153984&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
Thu Aug  4 19:57:03 2011
@@ -560,6 +560,13 @@ public abstract class AbstractConfigurat
         fireEvent(EVENT_CLEAR, null, null, false);
     }
 
+    /**
+     * {@inheritDoc} This implementation returns keys that either match the
+     * prefix or start with the prefix followed by a dot ('.'). So the call
+     * <code>getKeys("db");</code> will find the keys <code>db</code>,
+     * <code>db.user</code>, or <code>db.password</code>, but not
the key
+     * <code>dbdriver</code>.
+     */
     public Iterator getKeys(final String prefix)
     {
         return new FilterIterator(getKeys(), new Predicate()

Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/Configuration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/Configuration.java?rev=1153984&r1=1153983&r2=1153984&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/Configuration.java
(original)
+++ commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/Configuration.java
Thu Aug  4 19:57:03 2011
@@ -168,7 +168,15 @@ public interface Configuration
 
     /**
      * Get the list of the keys contained in the configuration that match the
-     * specified prefix.
+     * specified prefix. For instance, if the configuration contains the
+     * following keys:<br>
+     * <code>db.user, db.pwd, db.url, window.xpos, window.ypos</code>,<br>
+     * an invocation of <code>getKeys("db");</code><br>
+     * will return the keys below:<br>
+     * <code>db.user, db.pwd, db.url</code>.<br>
+     * Note that the prefix itself is included in the result set if there is a
+     * matching key. The exact behavior - how the prefix is actually
+     * interpreted - depends on a concrete implementation.
      *
      * @param prefix The prefix to test against.
      * @return An Iterator of keys that match the prefix.

Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java?rev=1153984&r1=1153983&r2=1153984&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java
Thu Aug  4 19:57:03 2011
@@ -841,7 +841,10 @@ public class HierarchicalConfiguration e
     /**
      * Returns an iterator with all keys defined in this configuration that
      * start with the given prefix. The returned keys will not contain any
-     * indices.
+     * indices. This implementation tries to locate a node whose key is the same
+     * as the passed in prefix. Then the subtree of this node is traversed, and
+     * the keys of all nodes encountered (including attributes) are added to the
+     * result set.
      *
      * @param prefix the prefix of the keys to start with
      * @return an iterator with the found keys



Mime
View raw message