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 2013/11/24 21:35:04 UTC

svn commit: r1545070 - /commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/fluent/DefaultParametersHandler.java

Author: oheger
Date: Sun Nov 24 20:35:03 2013
New Revision: 1545070

URL: http://svn.apache.org/r1545070
Log:
Added DefaultParametersHandler interface.

Objects implementing this interface can be registered at the Parameters class
to initialize newly created parameters object.

Added:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/fluent/DefaultParametersHandler.java

Added: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/fluent/DefaultParametersHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/fluent/DefaultParametersHandler.java?rev=1545070&view=auto
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/fluent/DefaultParametersHandler.java (added)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/fluent/DefaultParametersHandler.java Sun Nov 24 20:35:03 2013
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.configuration.builder.fluent;
+
+/**
+ * <p>
+ * Definition of an interface for setting default values for specific
+ * configuration parameter objects.
+ * </p>
+ * <p>
+ * An object implementing this interface knows how to initialize a parameters
+ * object of a specific class with default values. Such objects can be
+ * registered at the {@link Parameters} class. Whenever a specific parameters
+ * object is created all registered {@code DefaultParametersHandler} objects
+ * that can handle this parameters type are invoked, so that they get the chance
+ * to perform arbitrary initialization.
+ * </p>
+ *
+ * @version $Id: $
+ * @since 2.0
+ */
+public interface DefaultParametersHandler<T>
+{
+    /**
+     * Initializes the specified parameters object with default values. This
+     * method is called after the parameters object was created and before it is
+     * passed to the calling code. A concrete implementation can perform
+     * arbitrary initializations. Note that if there are multiple
+     * {@code DefaultParametersHandler} objects registered supporting this
+     * parameters type they are called in the order they have been registered.
+     * So handlers registered later can override initializations done by
+     * handlers registered earlier.
+     *
+     * @param parameters the parameters object to be initialized
+     */
+    void initializeDefaults(T parameters);
+}