commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1799503 - in /commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2: AbstractMapBasedConfiguration.java AbstractYAMLBasedConfiguration.java JSONConfiguration.java YAMLConfiguration.java
Date Wed, 21 Jun 2017 20:00:44 GMT
Author: oheger
Date: Wed Jun 21 20:00:43 2017
New Revision: 1799503

URL: http://svn.apache.org/viewvc?rev=1799503&view=rev
Log:
[CONFIGURATION-258] Renamed AbstractMapBasedConfiguration.

The name could be confused with MapConfiguration. Added some more
comments.

Added:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/AbstractYAMLBasedConfiguration.java
      - copied, changed from r1799502, commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/AbstractMapBasedConfiguration.java
Removed:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/AbstractMapBasedConfiguration.java
Modified:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/JSONConfiguration.java
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/YAMLConfiguration.java

Copied: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/AbstractYAMLBasedConfiguration.java
(from r1799502, commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/AbstractMapBasedConfiguration.java)
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/AbstractYAMLBasedConfiguration.java?p2=commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/AbstractYAMLBasedConfiguration.java&p1=commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/AbstractMapBasedConfiguration.java&r1=1799502&r2=1799503&rev=1799503&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/AbstractMapBasedConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/AbstractYAMLBasedConfiguration.java
Wed Jun 21 20:00:43 2017
@@ -25,15 +25,35 @@ import java.util.HashMap;
 import java.util.Map;
 
 /**
- * @author The-Alchemist
+ * <p>
+ * A base class for configuration implementations based on YAML structures.
+ * </p>
+ * <p>
+ * This base class offers functionality related to YAML-like data structures
+ * based on maps. Such a map has strings as keys and arbitrary objects as
+ * values. The class offers methods to transform such a map into a hierarchy
+ * of {@link ImmutableNode} objects and vice versa.
+ * </p>
+ *
+ * @since 2.2
  */
-public class AbstractMapBasedConfiguration extends BaseHierarchicalConfiguration
+public class AbstractYAMLBasedConfiguration extends BaseHierarchicalConfiguration
 {
-    protected AbstractMapBasedConfiguration()
+    /**
+     * Creates a new instance of {@code AbstractYAMLBasedConfiguration}.
+     */
+    protected AbstractYAMLBasedConfiguration()
     {
         initLogger(new ConfigurationLogger(getClass()));
     }
 
+    /**
+     * Loads this configuration from the content of the specified map. The data
+     * in the map is transformed into a hierarchy of {@link ImmutableNode}
+     * objects.
+     *
+     * @param map the map to be processed
+     */
     protected void load(Map<String, Object> map)
     {
         ImmutableNode.Builder rootBuilder = new ImmutableNode.Builder();
@@ -99,6 +119,12 @@ public class AbstractMapBasedConfigurati
         return parent.create();
     }
 
+    /**
+     * Internal helper method to wrap an exception in a
+     * {@code ConfigurationException}.
+     * @param e the exception to be wrapped
+     * @throws ConfigurationException the resulting exception
+     */
     static void rethrowException(Exception e) throws ConfigurationException
     {
         if (e instanceof ClassCastException)

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/JSONConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/JSONConfiguration.java?rev=1799503&r1=1799502&r2=1799503&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/JSONConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/JSONConfiguration.java
Wed Jun 21 20:00:43 2017
@@ -36,7 +36,7 @@ import java.util.Map;
  *
  * @since 2.2
  */
-public class JSONConfiguration extends AbstractMapBasedConfiguration
+public class JSONConfiguration extends AbstractYAMLBasedConfiguration
         implements FileBasedConfiguration, InputStreamSupport
 {
     private final ObjectMapper mapper = new ObjectMapper();

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/YAMLConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/YAMLConfiguration.java?rev=1799503&r1=1799502&r2=1799503&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/YAMLConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/YAMLConfiguration.java
Wed Jun 21 20:00:43 2017
@@ -37,7 +37,7 @@ import java.util.Map;
  *
  * @since 2.2
  */
-public class YAMLConfiguration extends AbstractMapBasedConfiguration
+public class YAMLConfiguration extends AbstractYAMLBasedConfiguration
         implements FileBasedConfiguration, InputStreamSupport
 {
     /**



Mime
View raw message