You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by oh...@apache.org on 2014/05/19 21:55:57 UTC

svn commit: r1596019 - in /commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder: BasicConfigurationBuilder.java ConfigurationBuilder.java

Author: oheger
Date: Mon May 19 19:55:57 2014
New Revision: 1596019

URL: http://svn.apache.org/r1596019
Log:
Changed methods for registering event listeners for configuration builders.

The methods now use the generic event listener interface. (This commit breaks
the build as there are unresolved compilation failures.)

Modified:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/BasicConfigurationBuilder.java
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/BasicConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/BasicConfigurationBuilder.java?rev=1596019&r1=1596018&r2=1596019&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/BasicConfigurationBuilder.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/BasicConfigurationBuilder.java Mon May 19 19:55:57 2014
@@ -31,7 +31,9 @@ import org.apache.commons.configuration.
 import org.apache.commons.configuration.beanutils.ConstructorArg;
 import org.apache.commons.configuration.event.ConfigurationErrorListener;
 import org.apache.commons.configuration.event.ConfigurationListener;
+import org.apache.commons.configuration.event.EventListener;
 import org.apache.commons.configuration.event.EventSource;
+import org.apache.commons.configuration.event.EventType;
 import org.apache.commons.configuration.ex.ConfigurationException;
 import org.apache.commons.configuration.ex.ConfigurationRuntimeException;
 import org.apache.commons.lang3.event.EventListenerSupport;
@@ -365,7 +367,6 @@ public class BasicConfigurationBuilder<T
      *
      * @throws IllegalArgumentException if the listener is <b>null</b>
      */
-    @Override
     public void addBuilderListener(BuilderListener l)
     {
         if (l == null)
@@ -380,12 +381,21 @@ public class BasicConfigurationBuilder<T
      * {@inheritDoc} If the specified listener is not registered at this object,
      * this method has no effect.
      */
-    @Override
     public void removeBuilderListener(BuilderListener l)
     {
         builderListeners.removeListener(l);
     }
 
+    @Override
+    public <T1 extends ConfigurationBuilderEvent> void addEventListener(EventType<T1> eventType, EventListener<? super T1> listener) {
+        //TODO implementation
+    }
+
+    @Override
+    public <T1 extends ConfigurationBuilderEvent> void removeEventListener(EventType<T1> eventType, EventListener<? super T1> listener) {
+        //TODO implementation
+    }
+
     /**
      * Clears an existing result object. An invocation of this method causes a
      * new {@code Configuration} object to be created the next time

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java?rev=1596019&r1=1596018&r2=1596019&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java Mon May 19 19:55:57 2014
@@ -17,6 +17,8 @@
 package org.apache.commons.configuration.builder;
 
 import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.event.EventListener;
+import org.apache.commons.configuration.event.EventType;
 import org.apache.commons.configuration.ex.ConfigurationException;
 
 /**
@@ -49,16 +51,21 @@ public interface ConfigurationBuilder<T 
     T getConfiguration() throws ConfigurationException;
 
     /**
-     * Adds the specified {@code BuilderListener} to this builder.
+     * Adds an event listener for the given event type to this builder.
      *
-     * @param l the listener to be registered
+     * @param eventType the event type (must not be <b>null</b>)
+     * @param listener the listener to be registered (must not be <b>null</b>)
+     * @throws IllegalArgumentException if a required parameter is <b>null</b>
      */
-    void addBuilderListener(BuilderListener l);
+    <T extends ConfigurationBuilderEvent> void addEventListener(
+            EventType<T> eventType, EventListener<? super T> listener);
 
     /**
-     * Removes the specified {@code BuilderListener} from this builder.
+     * Removes the specified {@code EventListener} from this builder.
      *
-     * @param l the listener to be removed
+     * @param eventType the event type
+     * @param listener the listener to be removed
      */
-    void removeBuilderListener(BuilderListener l);
+    <T extends ConfigurationBuilderEvent> void removeEventListener(
+            EventType<T> eventType, EventListener<? super T> listener);
 }