commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1153992 - in /commons/proper/configuration/branches/configuration2_experimental/src: changes/ main/java/org/apache/commons/configuration2/
Date Thu, 04 Aug 2011 20:07:06 GMT
Author: oheger
Date: Thu Aug  4 20:07:05 2011
New Revision: 1153992

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

Modified:
    commons/proper/configuration/branches/configuration2_experimental/src/changes/changes.xml
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/Configuration.java

Modified: commons/proper/configuration/branches/configuration2_experimental/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/changes/changes.xml?rev=1153992&r1=1153991&r2=1153992&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/changes/changes.xml
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/changes/changes.xml
Thu Aug  4 20:07:05 2011
@@ -84,6 +84,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/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java?rev=1153992&r1=1153991&r2=1153992&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
Thu Aug  4 20:07:05 2011
@@ -609,10 +609,12 @@ public abstract class AbstractConfigurat
 
     /**
      * A default implementation of the {@code getKeys(String prefix)} method.
-     * This implementation returns a special prefix iterator for obtaining all
-     * keys starting with the specified prefix. This is fully functional.
-     * However, derived classes may implement {@code getKeys(String)} in a more
-     * efficient way.
+     * This implementation returns a special prefix iterator which accept keys
+     * that either match the prefix or start with the prefix followed by a dot
+     * ('.'). So the call {@code getKeys("db");} will find the keys {@code db},
+     * {@code db.user}, or {@code db.password}, but not the key {@code dbdriver}
+     * . This is fully functional. However, derived classes may implement
+     * {@code getKeys(String)} in a more efficient way.
      *
      * @param prefix the prefix for the keys
      * @return an iterator with all the keys starting with this prefix

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java?rev=1153992&r1=1153991&r2=1153992&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java
Thu Aug  4 20:07:05 2011
@@ -655,7 +655,10 @@ public abstract class AbstractHierarchic
     /**
      * 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

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/Configuration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/Configuration.java?rev=1153992&r1=1153991&r2=1153992&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/Configuration.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/Configuration.java
Thu Aug  4 20:07:05 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},<br>
+     * an invocation of {@code getKeys("db");}<br>
+     * will return the keys below:<br>
+     * {@code db.user, db.pwd, db.url}.<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.



Mime
View raw message