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/09/13 17:36:52 UTC
svn commit: r1624753 [1/3] - in /commons/proper/configuration/trunk: ./
src/main/java/org/apache/commons/configuration/
src/main/java/org/apache/commons/configuration2/ src/main/javacc/
src/site/xdoc/ src/site/xdoc/userguide/ src/test/java/org/apache/c...
Author: oheger
Date: Sat Sep 13 15:36:51 2014
New Revision: 1624753
URL: http://svn.apache.org/r1624753
Log:
Merged changes from 2.0 alpha branch back into trunk.
Added:
commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/ (props changed)
- copied from r1624751, commons/proper/configuration/branches/configuration2-alpha/src/main/java/org/apache/commons/configuration2/
commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/ (props changed)
- copied from r1624751, commons/proper/configuration/branches/configuration2-alpha/src/test/java/org/apache/commons/configuration2/
Removed:
commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/
Modified:
commons/proper/configuration/trunk/ (props changed)
commons/proper/configuration/trunk/pom.xml
commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/ (props changed)
commons/proper/configuration/trunk/src/main/javacc/PropertyListParser.jj
commons/proper/configuration/trunk/src/site/xdoc/ (props changed)
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_basicfeatures.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_beans.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_builders.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_combinedbuilder.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_combinedconfiguration.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_compositeconfiguration.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_concurrency.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_events.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_filebased.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_hierarchical.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_multitenant.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_properties.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_reloading.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_utilities.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_xml.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/overview.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/upgradeto2_0.xml
commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/reloading/TestVFSFileHandlerReloadingDetector.java (props changed)
commons/proper/configuration/trunk/src/test/resources/testCCCustomProvider.xml
commons/proper/configuration/trunk/src/test/resources/testCCEntityResolver.xml
commons/proper/configuration/trunk/src/test/resources/testCCFileSystem.xml
commons/proper/configuration/trunk/src/test/resources/testCCFileSystemSubConfig.xml
commons/proper/configuration/trunk/src/test/resources/testCCLookup.xml
commons/proper/configuration/trunk/src/test/resources/testCCMultiTenent.xml
commons/proper/configuration/trunk/src/test/resources/testCCMultiTenentReloading.xml
commons/proper/configuration/trunk/src/test/resources/testCCResultClass.xml
commons/proper/configuration/trunk/src/test/resources/testCCResultInitialization.xml
commons/proper/configuration/trunk/src/test/resources/testComplexInitialization.xml
commons/proper/configuration/trunk/src/test/resources/testConfigurationInterpolatorUpdate.xml (contents, props changed)
commons/proper/configuration/trunk/src/test/resources/testConfigurationProvider.xml
commons/proper/configuration/trunk/src/test/resources/testDigesterCreateObject.xml
commons/proper/configuration/trunk/src/test/resources/testExpression.xml
commons/proper/configuration/trunk/src/test/resources/testExtendedClass.xml
commons/proper/configuration/trunk/src/test/resources/testExtendedXMLConfigurationProvider.xml
commons/proper/configuration/trunk/src/test/resources/testFileReloadConfigurationBuilder.xml
commons/proper/configuration/trunk/src/test/resources/testFileReloadConfigurationBuilder2.xml
commons/proper/configuration/trunk/src/test/resources/testFileSystem.xml
commons/proper/configuration/trunk/src/test/resources/testGlobalLookup.xml
commons/proper/configuration/trunk/src/test/resources/testInterpolationBuilder.xml
commons/proper/configuration/trunk/src/test/resources/testMultiTenentConfigurationBuilder.xml
commons/proper/configuration/trunk/src/test/resources/testMultiTenentConfigurationBuilder2.xml
commons/proper/configuration/trunk/src/test/resources/testMultiTenentConfigurationBuilder3.xml
commons/proper/configuration/trunk/src/test/resources/testMultiTenentConfigurationBuilder4.xml
commons/proper/configuration/trunk/src/test/resources/testMultiTenentConfigurationBuilder5.xml
commons/proper/configuration/trunk/src/test/resources/testSystemProperties.xml (contents, props changed)
commons/proper/configuration/trunk/src/test/resources/testVFSMultiTenentConfigurationBuilder1.xml
commons/proper/configuration/trunk/src/test/resources/testVFSMultiTenentConfigurationBuilder2.xml
commons/proper/configuration/trunk/src/test/resources/testValidation.xml
commons/proper/configuration/trunk/src/test/resources/testValidation2.xml
commons/proper/configuration/trunk/src/test/resources/testValidation3.xml
Propchange: commons/proper/configuration/trunk/
------------------------------------------------------------------------------
Merged /commons/proper/configuration/branches/configuration2-alpha:r1624597-1624751
Modified: commons/proper/configuration/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/pom.xml?rev=1624753&r1=1624752&r2=1624753&view=diff
==============================================================================
--- commons/proper/configuration/trunk/pom.xml (original)
+++ commons/proper/configuration/trunk/pom.xml Sat Sep 13 15:36:51 2014
@@ -28,8 +28,8 @@
<version>34</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>commons-configuration</groupId>
- <artifactId>commons-configuration</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-configuration2</artifactId>
<version>2.0-alpha1-SNAPSHOT</version>
<name>Apache Commons Configuration</name>
@@ -500,7 +500,7 @@
</excludes>
<systemPropertyVariables>
<java.awt.headless>true</java.awt.headless>
- <org.apache.commons.logging.Log>org.apache.commons.configuration.Logging</org.apache.commons.logging.Log>
+ <org.apache.commons.logging.Log>org.apache.commons.configuration2.Logging</org.apache.commons.logging.Log>
</systemPropertyVariables>
</configuration>
</plugin>
Propchange: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/
------------------------------------------------------------------------------
Merged /commons/proper/configuration/branches/configuration2-alpha/src/main/java/org/apache/commons/configuration:r1624597-1624751
Propchange: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Sep 13 15:36:51 2014
@@ -0,0 +1,4 @@
+/commons/proper/configuration/branches/CONFIGURATION_390/src/java/org/apache/commons/configuration:819412-822131
+/commons/proper/configuration/branches/configuration2-alpha/src/main/java/org/apache/commons/configuration2:1624601-1624751
+/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2:751544-751840,755692,757108
+/commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration:1561338-1588830
Modified: commons/proper/configuration/trunk/src/main/javacc/PropertyListParser.jj
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/javacc/PropertyListParser.jj?rev=1624753&r1=1624752&r2=1624753&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/javacc/PropertyListParser.jj (original)
+++ commons/proper/configuration/trunk/src/main/javacc/PropertyListParser.jj Sat Sep 13 15:36:51 2014
@@ -22,14 +22,14 @@ options {
PARSER_BEGIN(PropertyListParser)
-package org.apache.commons.configuration.plist;
+package org.apache.commons.configuration2.plist;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
-import org.apache.commons.configuration.HierarchicalConfiguration;
-import org.apache.commons.configuration.tree.ImmutableNode;
+import org.apache.commons.configuration2.HierarchicalConfiguration;
+import org.apache.commons.configuration2.tree.ImmutableNode;
import org.apache.commons.codec.binary.Hex;
Propchange: commons/proper/configuration/trunk/src/site/xdoc/
------------------------------------------------------------------------------
Merged /commons/proper/configuration/branches/configuration2-alpha/src/site/xdoc:r1624597-1624751
Modified: commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_basicfeatures.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_basicfeatures.xml?rev=1624753&r1=1624752&r2=1624753&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_basicfeatures.xml (original)
+++ commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_basicfeatures.xml Sat Sep 13 15:36:51 2014
@@ -28,7 +28,7 @@
<p>
The <code>Configuration</code> interface defines a whole bunch of methods.
Implementing these methods all from scratch can be quite hard. Because of
- that the <code><a href="../apidocs/org/apache/commons/configuration/AbstractConfiguration.html">
+ that the <code><a href="../apidocs/org/apache/commons/configuration2/AbstractConfiguration.html">
AbstractConfiguration</a></code> class exists. This class serves as a
common base class for most of the <code>Configuration</code> implementations
in <em>Commons Configuration</em> and provides a great deal of the
@@ -108,7 +108,7 @@ long longValue = config.getLong("NonExis
generated from a single string. To achieve this, an
<code>AbstractConfiguration</code> instance collaborates with an object
implementing the
- <code><a href="../apidocs/org/apache/commons/configuration/convert/ListDelimiterHandler.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/convert/ListDelimiterHandler.html">
ListDelimiterHandler</a></code> interface. This interface defines methods
for dealing with objects that may contain multiple values. Examples of
such complex objects are arrays, lists, and strings containing a specific
@@ -118,7 +118,7 @@ long longValue = config.getLong("NonExis
</p>
<p>
Per default, <code>AbstractConfiguration</code> uses an instance of the
- <code><a href="../apidocs/org/apache/commons/configuration/convert/DisabledListDelimiterHandler.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/convert/DisabledListDelimiterHandler.html">
DisabledListDelimiterHandler</a></code> class as list handler. This
class can deal with lists and arrays, but it does not recognize any list
delimiter characters in strings. (Hence the name, as splitting of strings
@@ -126,7 +126,7 @@ long longValue = config.getLong("NonExis
</p>
<p>
An alternative implementation of <code>ListDelimiterHandler</code> is
- <code><a href="../apidocs/org/apache/commons/configuration/convert/DefaultListDelimiterHandler.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/convert/DefaultListDelimiterHandler.html">
DefaultListDelimiterHandler</a></code>. This class actually supports
string splitting; the list delimiter character has to be passed to the
constructor. Whenever a property is added to the configuration (or the
@@ -284,7 +284,7 @@ public class EchoLookup extends StrLooku
Now we want this class to be called for variables with the prefix
<code>echo</code>. For this purpose the <code>EchoLookup</code> class
has to be registered at the
- <code><a href="../apidocs/org/apache/commons/configuration/interpol/ConfigurationInterpolator.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/interpol/ConfigurationInterpolator.html">
ConfigurationInterpolator</a></code> class with the desired prefix.
<code>ConfigurationInterpolator</code> implements a thin wrapper over the
<code>StrLookup</code> API defined by Commons Lang. It has a static
@@ -338,7 +338,7 @@ user.file = ${expr:System.getProperty("u
<result/>
<lookups>
<lookup config-prefix="expr"
- config-class="org.apache.commons.configuration.interpol.ExprLookup">
+ config-class="org.apache.commons.configuration2.interpol.ExprLookup">
<variables>
<variable name="System" value="Class:java.lang.System"/>
<variable name"net" value="Class:java.net.InetAddress"/>
@@ -367,7 +367,7 @@ user.file = ${expr:System.getProperty("u
<result/>
<lookups>
<lookup config-prefix="expr"
- config-class="org.apache.commons.configuration.interpol.ExprLookup">
+ config-class="org.apache.commons.configuration2.interpol.ExprLookup">
<variables>
<variable name"net" value="Class:java.net.InetAddress"/>
<variable name="String" value="Class:org.apache.commons.lang.StringUtils"/>
@@ -376,7 +376,7 @@ user.file = ${expr:System.getProperty("u
</lookups>
</header>
<override>
- <xml fileName="${expr:$[sys:basePath] +
+ <xml fileName="${expr:$[sys:basePath] +
String.lowercase(net.localHost.hostName) + '/testMultiConfiguration_default.xml'}"
config-name="defaultConfig" delimiterParsingDisabled="true">
</xml>
@@ -388,7 +388,7 @@ user.file = ${expr:System.getProperty("u
<subsection name="Data type conversions">
<p>
As was already mentioned when discussing the
- <code><a href="../apidocs/org/apache/commons/configuration/Configuration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/Configuration.html">
Configuration</a></code> interface, there are various <code>get()</code>
methods returning property values in different target data types. If
necessary, a data type conversion is performed. Take a look at the
@@ -466,7 +466,7 @@ int theAnswer = config.getInt("answer");
standard types out of the box. In addition to the result types of the
<code>get()</code> methods in the <code>Configuration</code> interface,
some more types are supported. These are listed in the documentation of the
- <code><a href="../apidocs/org/apache/commons/configuration/DataConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/DataConfiguration.html">
DataConfiguration</a></code> class. <code>DataConfiguration</code> is a
<em>decorator</em> providing additional data type conversion methods for
more target types; these additional methods are implemented on top of the
@@ -476,7 +476,7 @@ int theAnswer = config.getInt("answer");
If your application deals with special objects, there may be the
requirement to extend the conversion capabilities offered by the
library. To support this use case, there is the
- <code><a href="../apidocs/org/apache/commons/configuration/convert/ConversionHandler.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/convert/ConversionHandler.html">
ConversionHandler</a></code> interface. Each instance of a configuration
class derived from <code>AbstractConfiguration</code> is associated with
such a <code>ConversionHandler</code> object. The interface defines
@@ -496,7 +496,7 @@ int theAnswer = config.getInt("answer");
<p>
If the conversion facilities provided by <em>Commons Configuration</em>
are not to be fully replaced, but only extended by some custom types,
- the class <code><a href="../apidocs/org/apache/commons/configuration/convert/DefaultConversionHandler.html">
+ the class <code><a href="../apidocs/org/apache/commons/configuration2/convert/DefaultConversionHandler.html">
DefaultConversionHandler</a></code> is a good starting point. As the name
implies, an instance of this class is used per default for doing type
conversions. <code>DefaultConversionHandler</code> has some protected
Modified: commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_beans.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_beans.xml?rev=1624753&r1=1624752&r2=1624753&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_beans.xml (original)
+++ commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_beans.xml Sat Sep 13 15:36:51 2014
@@ -73,17 +73,17 @@
On the Java side three entities are involved in the creation of a bean:
<ul>
<li>A <em>bean factory</em>: This is an object that implements the
- <code><a href="../apidocs/org/apache/commons/configuration/beanutils/BeanFactory.html">BeanFactory</a></code>
+ <code><a href="../apidocs/org/apache/commons/configuration2/beanutils/BeanFactory.html">BeanFactory</a></code>
interface and knows how to create an instance of a bean class. In most
cases calling code does not directly deal with a bean factory.</li>
<li>An implementation of the
- <code><a href="../apidocs/org/apache/commons/configuration/beanutils/BeanDeclaration.html">BeanDeclaration</a></code>
+ <code><a href="../apidocs/org/apache/commons/configuration2/beanutils/BeanDeclaration.html">BeanDeclaration</a></code>
interface. This object knows how the bean declaration in the configuration
file is organized and how the needed information can be extracted. So
the way the bean is declared in the configuration file must match the
expectations of this object.</li>
<li>The helper class
- <code><a href="../apidocs/org/apache/commons/configuration/beanutils/BeanHelper.html">BeanHelper</a></code>
+ <code><a href="../apidocs/org/apache/commons/configuration2/beanutils/BeanHelper.html">BeanHelper</a></code>
brings all these together and performs the bean creation operation.
Usually client code will create a <code>BeanDeclaration</code> object
from a <code>Configuration</code> implementation and then pass it to
@@ -94,7 +94,7 @@
provided, which in many cases can be used out of the box.
</p>
</subsection>
-
+
<subsection name="An Example">
<p>
After this theory let's get into practice using an example. Consider a
@@ -121,13 +121,13 @@ public class DefaultWindowManager implem
private boolean resizable;
// do windows have a close button?
private boolean closable;
-
+
// Default size of new windows
private int defaultWidth;
private int defaultHeight;
-
+
WindowStyleDefinition styleDefinition;
-
+
// getters and setters ommitted, also the WindowManager methods
}
]]></source>
@@ -192,11 +192,11 @@ WindowManager wm = (WindowManager) BeanH
<p>
This fragment loads the configuration file using a <code>XMLConfiguration</code>
object. Then a bean declaration object is created, in this case an
- instance of the <code><a href="../apidocs/org/apache/commons/configuration/beanutils/XMLBeanDeclaration.html">XMLBeanDeclaration</a></code>
+ instance of the <code><a href="../apidocs/org/apache/commons/configuration2/beanutils/XMLBeanDeclaration.html">XMLBeanDeclaration</a></code>
class, which can deal with bean declarations in XML documents. This
declaration is passed to the <code>createBean()</code> method of
the default instance of the
- <code><a href="../apidocs/org/apache/commons/configuration/beanutils/BeanHelper.html">BeanHelper</a></code>
+ <code><a href="../apidocs/org/apache/commons/configuration2/beanutils/BeanHelper.html">BeanHelper</a></code>
class, which returns the new bean instance.
</p>
<p>
@@ -212,7 +212,7 @@ WindowManager wm = (WindowManager) BeanH
<code>BeanFactory</code> objects that are registered under a specific
key. The <code>BeanDeclaration</code> can contain the key of the
<code>BeanFactory</code> to be used. Please refer to the
- JavaDocs of <code><a href="../apidocs/org/apache/commons/configuration/beanutils/XMLBeanDeclaration.html">
+ JavaDocs of <code><a href="../apidocs/org/apache/commons/configuration2/beanutils/XMLBeanDeclaration.html">
XMLBeanDeclaration</a></code> for further information.</li>
<li>When a <code>BeanHelper</code> object is constructed a default
<code>BeanFactory</code> is set. This one is used if no specific
@@ -222,7 +222,7 @@ WindowManager wm = (WindowManager) BeanH
default <code>BeanHelper</code> instance which is available via the
static <code>INSTANCE</code> member field (as shown in the example
fragment above). This instance uses a
- <code><a href="../apidocs/org/apache/commons/configuration/beanutils/DefaultBeanFactory.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/beanutils/DefaultBeanFactory.html">
DefaultBeanFactory</a></code> object as bean factory.
Otherwise, specialized <code>BeanHelper</code>
instances can be created that are configured with other bean factories.
@@ -268,7 +268,7 @@ public class WindowStyleDefinition
In order to create an instance of <code>WindowStyleDefinition</code>,
we have to pass the foreground and background colors and a standard
font to the constructor. The colors are simple strings while a font is
- again a complex object. The following code fragement shows the complete
+ again a complex object. The following code fragement shows the complete
bean declaration for this scenario:
</p>
<source><![CDATA[
@@ -327,7 +327,7 @@ public class MyBean
{
...
}
-
+
public MyBean(int ivalue)
{
...
@@ -393,7 +393,7 @@ public class MyBean
than the ones supported by the available default implementations. Then it
is the responsibility of your implementation to parse the configuration
data and extract the required information to create the bean. Basically
- your <code><a href="../apidocs/org/apache/commons/configuration/beanutils/BeanDeclaration.html">BeanDeclaration</a></code>
+ your <code><a href="../apidocs/org/apache/commons/configuration2/beanutils/BeanDeclaration.html">BeanDeclaration</a></code>
implementation must be able to provide the following data:
<ul>
<li>The name of the class for which an instance is to be created.</li>
@@ -420,7 +420,7 @@ public class MyBean
allows you to adapt the format of bean declarations in configuration files,
you can manipulate the bean creation mechanism itself by creating a
specialized implementation of the
- <code><a href="../apidocs/org/apache/commons/configuration/beanutils/BeanFactory.html">BeanFactory</a></code>
+ <code><a href="../apidocs/org/apache/commons/configuration2/beanutils/BeanFactory.html">BeanFactory</a></code>
interface. For this purpose the following steps are necessary:
<ol>
<li>Create a class implementing the <code>BeanFactory</code> interface.
@@ -443,7 +443,7 @@ public class MyBean
<p>
We start with the creation of the factory class. The basic idea is that
the functionality for creating and initializing beans is already provided
- by the <code><a href="../apidocs/org/apache/commons/configuration/beanutils/DefaultBeanFactory.html">DefaultBeanFactory</a></code>
+ by the <code><a href="../apidocs/org/apache/commons/configuration2/beanutils/DefaultBeanFactory.html">DefaultBeanFactory</a></code>
class, so we extend this class. Our implementation only has to deal with
the singleton stuff: We keep a map that stores already created bean
instances and can be accessed by the name of their classes. In the
@@ -461,13 +461,13 @@ public class SingletonBeanFactory extend
{
/** A map for the so far created instances.*/
private final Map<String, Object> beans;
-
+
public SingletonBeanFactory()
{
super();
beans = new HashMap<String, Object>();
}
-
+
// Creates the bean. Checks if already an instance exists.
public synchronized Object createBean(BeanCreationContext bcc) throws Exception
{
@@ -490,7 +490,7 @@ public class SingletonBeanFactory extend
]]></source>
<p>
The main method to define is <code>createBean()</code>. It is passed
- a <code><a href="../apidocs/org/apache/commons/configuration/beanutils/BeanCreationContext.html">
+ a <code><a href="../apidocs/org/apache/commons/configuration2/beanutils/BeanCreationContext.html">
BeanCreationContext</a></code> object which contains all information
required for creating a bean (e.g. via reflection).
Note the <b>synchronized</b> key word, which is necessary because the
Modified: commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_builders.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_builders.xml?rev=1624753&r1=1624752&r2=1624753&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_builders.xml (original)
+++ commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_builders.xml Sat Sep 13 15:36:51 2014
@@ -36,11 +36,11 @@
<subsection name="Configuration Builders">
<p>
<em>Commons Configuration</em> defines the generic
- <code><a href="../apidocs/org/apache/commons/configuration/builder/ConfigurationBuilder.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/ConfigurationBuilder.html">
ConfigurationBuilder</a></code> interface which is used for creating
initialized configuration objects. The interface defines a
<code>getConfiguration()</code> method returning a generic type
- derived from <code>Configuration</code>. Here a specific
+ derived from <code>Configuration</code>. Here a specific
<code>Configuration</code> implementation class can be inserted.
</p>
<p>
@@ -80,7 +80,7 @@
<em>Commons Configuration</em> provides multiple concrete
<code>ConfigurationBuilder</code> implementations supporting different
features. The most basic implementation is
- <code><a href="../apidocs/org/apache/commons/configuration/builder/BasicConfigurationBuilder.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/BasicConfigurationBuilder.html">
BasicConfigurationBuilder</a></code>. It is the base class for all other
builder implementations and defines a framework for creating and
initializing configuration objects. The functionality provided is as
@@ -140,7 +140,7 @@ PropertiesConfiguration config = builder
Basically, initialization parameters are defined by POJOs (plain old
Java objects) with properties corresponding to the special properties
supported by the configuration object to be created. In the package
- <code>org.apache.commons.configuration.builder.fluent</code> a number
+ <code>org.apache.commons.configuration2.builder.fluent</code> a number
of interfaces is contained defining the possible initialization
parameters for the standard <code>Configuration</code> implementations
shipped with <em>Commons Configuration</em>. These interfaces form a
@@ -148,7 +148,7 @@ PropertiesConfiguration config = builder
used by concrete <code>Configuration</code> implementations. So there is
a fundamental set of initialization parameters supported by all classes
derived from
- <code><a href="../apidocs/org/apache/commons/configuration/AbstractConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/AbstractConfiguration.html">
AbstractConfiguration</a></code>. Configurations loaded from a file
also support these parameters plus additional ones for defining the file
to be loaded. An XML-based configuration supports all basic and
@@ -158,7 +158,7 @@ PropertiesConfiguration config = builder
<p>
Exposing such parameter objects via a fluent interface becomes tricky in
Java if inheritance is involved. In <em>Commons Configuration</em> the
- <code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/Parameters.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/Parameters.html">
Parameters</a></code> class is responsible for the creation of parameters
objects. It serves as a type-safe factory for parameter objects with
support for inheritance. It defines a set of methods for creating
@@ -199,21 +199,21 @@ XMLBuilderParams xmlParams = params.xml(
</tr>
<tr>
<td><code>basic()</code></td>
- <td><code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/BasicBuilderParameters.html">
+ <td><code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/BasicBuilderParameters.html">
BasicBuilderParameters</a></code></td>
<td>Defines fundamental properties common to all <code>Configuration</code>
implementations derived from <code>AbstractConfiguration</code>.</td>
</tr>
<tr>
<td><code>fileBased()</code></td>
- <td><code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/FileBasedBuilderParameters.html">
+ <td><code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/FileBasedBuilderParameters.html">
FileBasedBuilderParameters</a></code></td>
<td>Properties related to file-based configurations. For instance,
multiple ways for defining the file to be loaded are provided.</td>
</tr>
<tr>
<td><code>combined()</code></td>
- <td><code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/CombinedBuilderParameters.html">
+ <td><code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/CombinedBuilderParameters.html">
CombinedBuilderParameters</a></code></td>
<td>This object is used by the specialized builder for combined
configurations. Here properties can be set which define the content
@@ -221,43 +221,43 @@ XMLBuilderParams xmlParams = params.xml(
</tr>
<tr>
<td><code>jndi()</code></td>
- <td><code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/JndiBuilderParameters.html">
+ <td><code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/JndiBuilderParameters.html">
JndiBuilderParameters</a></code></td>
<td>A parameters object for initializing JNDI configurations.</td>
</tr>
<tr>
<td><code>hierarchical()</code></td>
- <td><code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/HierarchicalBuilderParameters.html">
+ <td><code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/HierarchicalBuilderParameters.html">
HierarchicalBuilderParameters</a></code></td>
<td>Here special parameters common to all hierarchical configuratios are
defined, for instance the expression engine.</td>
</tr>
<tr>
<td><code>xml()</code></td>
- <td><code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/XMLBuilderParameters.html">
+ <td><code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/XMLBuilderParameters.html">
XMLBuilderParameters</a></code></td>
<td>The parameters for XML configurations.</td>
</tr>
<tr>
<td><code>properties()</code></td>
- <td><code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/PropertiesBuilderParameters.html">
+ <td><code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/PropertiesBuilderParameters.html">
PropertiesBuilderParameters</a></code></td>
<td>The parameters for <a href="howto_properties.html">properties
configurations</a>.</td>
</tr>
<tr>
<td><code>multiFile()</code></td>
- <td><code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/MultiFileBuilderParameters.html">
+ <td><code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/MultiFileBuilderParameters.html">
MultiFileBuilderParameters</a></code></td>
- <td>This parameters class is used by the builder for
+ <td>This parameters class is used by the builder for
<a href="howto_multitenant.html#MultiFileHierarchicalConfiguration">multi
file configurations</a>.</td>
</tr>
<tr>
<td><code>database()</code></td>
- <td><code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/DatabaseBuilderParameters.html">
+ <td><code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/DatabaseBuilderParameters.html">
DatabaseBuilderParameters</a></code></td>
- <td>The parameters for <code><a href="../apidocs/org/apache/commons/configuration/DatabaseConfiguration.html">
+ <td>The parameters for <code><a href="../apidocs/org/apache/commons/configuration2/DatabaseConfiguration.html">
DatabaseConfiguration</a></code>.</td>
</tr>
</table>
@@ -309,7 +309,7 @@ XMLBuilderParams xmlParams = params.xml(
repeat yourself) principle, <em>Commons Configuration</em> supports
default initialization parameters for configuration sources. It was
already shown how an instance of the
- <code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/Parameters.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/Parameters.html">
Parameters</a></code> class is used to create initialization parameter
objects for various types of configuration sources. In addtion to the
methods for creating these objects, <code>Parameters</code> also deals
@@ -319,7 +319,7 @@ XMLBuilderParams xmlParams = params.xml(
<code>Parameters</code> defines methods for registering so-called
<em>defaults handler</em> objects. A defaults handler is an object
implementing the
- <code><a href="../apidocs/org/apache/commons/configuration/builder/DefaultParametersHandler.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/DefaultParametersHandler.html">
DefaultParametersHandler</a></code> interface. This interface defines a
single method which accepts a parameters object of a generic type and
populates it according to its logic. Such handlers can be registered for
@@ -400,7 +400,7 @@ params.registerDefaultsHandler(Propertie
accross all modules to create parameter objects. The actual functionality
of managing and invoking <code>DefaultParametersHandler</code> objects is
implememented by the
- <code><a href="../apidocs/org/apache/commons/configuration/builder/DefaultParametersHandler.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/DefaultParametersHandler.html">
DefaultParametersManager</a></code> class - <code>Parameters</code> just
delegates to a wrapped instance. In some usage scenarios it may make sense
to use <code>DefaultParametersManager</code> directly.
@@ -411,7 +411,7 @@ params.registerDefaultsHandler(Propertie
<p>
After the registration of default handlers has been discussed, it is still
open how such handlers can be created. Because the
- <code><a href="../apidocs/org/apache/commons/configuration/builder/DefaultParametersHandler.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/DefaultParametersHandler.html">
DefaultParametersHandler</a></code> interface is very simple, it is easy
to create a specialized implementation. The following listing shows how
the <code>EncodingDefaultsHandler</code> from the previous example could
@@ -446,7 +446,7 @@ public class EncodingDefaultsHandler
implementation of a specialized <code>DefaultParametersHandler</code> is
not necessary because <em>Commons Configuration</em> provides a pretty
generic default implementation:
- <code><a href="../apidocs/org/apache/commons/configuration/builder/CopyObjectDefaultHandler.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/CopyObjectDefaultHandler.html">
CopyObjectDefaultHandler</a></code>. The name stems from the fact that a
handler is constructed from a parameters object to be used as reference.
In the <code>initializeDefaults()</code> method the handler copies all
Modified: commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_combinedbuilder.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_combinedbuilder.xml?rev=1624753&r1=1624752&r2=1624753&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_combinedbuilder.xml (original)
+++ commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_combinedbuilder.xml Sat Sep 13 15:36:51 2014
@@ -37,7 +37,7 @@
prefers a combined view on its configuration data. <em>Commons
Configuration</em> supports this use case with a special configuration
builder implementation:
- <code><a href="../apidocs/org/apache/commons/configuration/builder/combined/CombinedConfigurationBuilder.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/combined/CombinedConfigurationBuilder.html">
CombinedConfigurationBuilder</a></code>.
</p>
<p>
@@ -73,7 +73,7 @@
<code>XMLConfiguration</code> can be used to load configuration data from
a single source. <code>CombinedConfigurationBuilder</code> now allows
combining multiple configuration sources to a single
- <code><a href="../apidocs/org/apache/commons/configuration/CombinedConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/CombinedConfiguration.html">
CombinedConfiguration</a></code> object. The sources to be loaded have to
be defined in an XML document with a specific structure, a so-called
<em>configuration definition file</em>. The following listing shows a
@@ -106,7 +106,7 @@
configuration builders</a>: A new instance is created, and the
<code>configure()</code> method is called with initialization parameters
(<code>CombinedConfigurationBuilder</code> is derived from
- <code><a href="../apidocs/org/apache/commons/configuration/builder/BasicConfigurationBuilder.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/BasicConfigurationBuilder.html">
BasicConfigurationBuilder</a></code>; so all features common to
configuration builders are available here as well). The combined configuration collecting
all sources defined in the configuration definition file can then be
@@ -148,7 +148,7 @@ CombinedConfiguration config = builder.g
]]></source>
<p>
In this example, the <code>combined()</code> method of
- <code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/Parameters.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/Parameters.html">
Parameters</a></code> is used to obtain a special parameters object for a
combined configuration builder. Internally, again a builder for
constructing an <code>XMLConfiguration</code> for the definition file is
@@ -185,7 +185,7 @@ CombinedConfiguration config = builder.g
<p>
If you do not need any specific initialization and just want to read the
configuration definition from an XML document, the
- <code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/Configurations.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/Configurations.html">
Configurations</a></code> helper class introduced in section
<a href="howto_filebased.html#Making_it_easier">Making it easier</a> is
made for you. It offers convenience methods for creating a builder for
@@ -544,24 +544,24 @@ CombinedConfigurationBuilder builder = c
attribute. Which configuration class is created by this tag
depends on the extension of the file to load: If the extension
is ".xml", a
- <code><a href="../apidocs/org/apache/commons/configuration/XMLPropertiesConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/XMLPropertiesConfiguration.html">
XMLPropertiesConfiguration</a></code> object is
created, which is able to process the XML properties format
introduced in Java 5.0. Otherwise a
- <code><a href="../apidocs/org/apache/commons/configuration/PropertiesConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/PropertiesConfiguration.html">
PropertiesConfiguration</a></code> object is created, the default reader
for properties files.</dd>
<dt>xml</dt>
<dd>The <code>xml</code> element can be used to load XML configuration
files. It also uses the <code>fileName</code> attribute to
determine the name of the file to load and creates an instance
- of <code><a href="../apidocs/org/apache/commons/configuration/XMLConfiguration.html">
+ of <code><a href="../apidocs/org/apache/commons/configuration2/XMLConfiguration.html">
XMLConfiguration</a></code>.</dd>
<dt>jndi</dt>
<dd>As the name implies, with this element JNDI resources can be
included in the resulting configuration. Under the hood this is
done by an instance of the
- <code><a href="../apidocs/org/apache/commons/configuration/JndiConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/JndiConfiguration.html">
JndiConfiguration</a></code> class. The <code>prefix</code> attribute
can be used to select a subset of the JNDI tree.</dd>
<dt>plist</dt>
@@ -569,14 +569,14 @@ CombinedConfigurationBuilder builder = c
files in the NeXT / OpenStep or Mac OS X format. Again the
name of the file to load is specified through the
<code>fileName</code> attribute. If a XML file is specified,
- a <code><a href="../apidocs/org/apache/commons/configuration/plist/XMLPropertyListConfiguration.html">
+ a <code><a href="../apidocs/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.html">
XMLPropertyListConfiguration</a></code> object is created
to process the file. Otherwise, this task is delegated to a
- <code><a href="../apidocs/org/apache/commons/configuration/plist/PropertyListConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/plist/PropertyListConfiguration.html">
PropertyListConfiguration</a></code> instance.</dd>
<dt>system</dt>
<dd>With this element an instance of
- <code><a href="../apidocs/org/apache/commons/configuration/SystemConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/SystemConfiguration.html">
SystemConfiguration</a></code> is added to the resulting configuration
allowing access to system properties. <em>Note:</em> Using this element
system properties are directly made available. Alternatively the
@@ -586,7 +586,7 @@ CombinedConfigurationBuilder builder = c
<dt>ini</dt>
<dd>This tag can be used to include an ini file into the resulting
combined configuration. Behind the scenes an instance of
- <code><a href="../apidocs/org/apache/commons/configuration/INIConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/INIConfiguration.html">
INIConfiguration</a></code> is used to load the ini file.</dd>
<dt>env</dt>
<dd>With this tag direct access to environment properties can be enabled.
@@ -635,7 +635,7 @@ CombinedConfigurationBuilder builder = c
config-class="com.foo.MyReloadingDetector" strict=true"/>
</properties>
<xml fileName="test.xml" validating="true">
- <expressionEngine config-class="org.apache.commons.configuration.tree.xpath.XPathExpressionEngine"/>
+ <expressionEngine config-class="org.apache.commons.configuration2.tree.xpath.XPathExpressionEngine"/>
</xml>
]]></source>
<p>
@@ -648,7 +648,7 @@ CombinedConfigurationBuilder builder = c
initialized in a similar way: a simple property is set, and an expression
engine is assigned. In fact, the properties defined in these declarations
are not directly set on configuration instances, but on
- <a href="howto_builders.html#Initialization_Parameters">initialization
+ <a href="howto_builders.html#Initialization_Parameters">initialization
parameters objects</a> for configuration builders. These builders are
created for the declared configuration sources and configured with the
defined properties. Then their managed configurations are obtained and
@@ -782,8 +782,8 @@ CombinedConfigurationBuilder builder = c
<source><![CDATA[
<header>
<result throwExceptionOnMissing="true">
- <nodeCombiner config-class="org.apache.commons.configuration.tree.OverrideCombiner"/>
- <expressionEngine config-class="org.apache.commons.configuration.tree.xpath.XPathExpressionEngine"/>
+ <nodeCombiner config-class="org.apache.commons.configuration2.tree.OverrideCombiner"/>
+ <expressionEngine config-class="org.apache.commons.configuration2.tree.xpath.XPathExpressionEngine"/>
</result>
<combiner>
<override>
@@ -829,7 +829,7 @@ CombinedConfigurationBuilder builder = c
<configuration>
<header>
<fileSystem
- config-class="org.apache.commons.configuration.io.VFSFileSystem"/>
+ config-class="org.apache.commons.configuration2.io.VFSFileSystem"/>
</header>
<xml fileName="test.xml" config-name="xml"/>
</configuration>
@@ -894,15 +894,15 @@ CombinedConfigurationBuilder builder = c
To enable reloading support for combined configurations, <em>Commons
Configuration</em> provides a special extension of
<code>CombinedConfigurationBuilder</code>:
- <code><a href="../apidocs/org/apache/commons/configuration/builder/combined/ReloadingCombinedConfigurationBuilder.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/combined/ReloadingCombinedConfigurationBuilder.html">
ReloadingCombinedConfigurationBuilder</a></code>. The relation between the
two is analogous to the relation between
- <code><a href="../apidocs/org/apache/commons/configuration/builder/FileBasedConfigurationBuilder.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/FileBasedConfigurationBuilder.html">
FileBasedConfigurationBuilder</a></code> and
- <code><a href="../apidocs/org/apache/commons/configuration/builder/ReloadingFileBasedConfigurationBuilder.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/ReloadingFileBasedConfigurationBuilder.html">
ReloadingFileBasedConfigurationBuilder</a></code>. The reloading-enabled
variant of combined configuration builder manages and exposes a special
- <code><a href="../apidocs/org/apache/commons/configuration/reloading/ReloadingController.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/reloading/ReloadingController.html">
ReloadingController</a></code> that can be used to trigger reloading
checks. (Please refer to the chapter about <a href="howto_reloading.html">reloading</a>
for a detailed describtion of the reloading implementation in <em>Commons
@@ -941,7 +941,7 @@ CombinedConfigurationBuilder builder = c
possible. This may not be supported by all types of configuration
sources, but it is for instance for file-based configuration sources; in
this case the builder created for a source with enabled reloading support
- is of type <code><a href="../apidocs/org/apache/commons/configuration/builder/ReloadingFileBasedConfigurationBuilder.html">
+ is of type <code><a href="../apidocs/org/apache/commons/configuration2/builder/ReloadingFileBasedConfigurationBuilder.html">
ReloadingFileBasedConfigurationBuilder</a></code>.
</p>
<p>
@@ -961,9 +961,9 @@ CombinedConfigurationBuilder builder = c
<configuration>
<header>
<result>
- <expressionEngine config-class="org.apache.commons.configuration.tree.xpath.XPathExpressionEngine"/>
+ <expressionEngine config-class="org.apache.commons.configuration2.tree.xpath.XPathExpressionEngine"/>
<listDelimiterHandler
- config-class="org.apache.commons.configuration.convert.DefaultListDelimiterHandler">
+ config-class="org.apache.commons.configuration2.convert.DefaultListDelimiterHandler">
<config-constrarg config-value=","/>
</listDelimiterHandler>
</result>
@@ -1024,7 +1024,7 @@ CombinedConfiguration cc = builder.getCo
engine for the resulting configuration. So we can query our properties
using the convenient XPATH syntax. We also enabled list delimiter parsing
by specifying a
- <code><a href="../apidocs/org/apache/commons/configuration/convert/DefaultListDelimiterHandler.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/convert/DefaultListDelimiterHandler.html">
DefaultListDelimiterHandler</a></code> object. (Note the syntax for
creating a bean instance via its constructor.) By providing the <code>config-name</code>
attribute we have given all configuration sources a name. These names can
@@ -1059,7 +1059,7 @@ Configuration tab2Config = ccAdd.getConf
trigger has to be used to ensure that the reloading controller managed by
the builder is called in regular intervals. This can be done in the same
way as for simple configuration sources, for instance by setting up a
- <code><a href="../apidocs/org/apache/commons/configuration/reloading/PeriodicReloadingTrigger.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/reloading/PeriodicReloadingTrigger.html">
PeriodicReloadingTrigger</a></code> object:
</p>
<source><![CDATA[
@@ -1075,7 +1075,7 @@ trigger.start();
declare instances of this class in a configuration definition file, too.
<code>CombinedConfigurationBuilder</code> supports this use case by
registering a
- <code><a href="../apidocs/org/apache/commons/configuration/builder/combined/ConfigurationBuilderProvider.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/combined/ConfigurationBuilderProvider.html">
ConfigurationBuilderProvider</a></code> object.
</p>
<p>
@@ -1098,7 +1098,7 @@ trigger.start();
<p>
There is already a fully functional implementation of the
<code>ConfigurationBuilderProvider</code> interface available in the class
- <code><a href="../apidocs/org/apache/commons/configuration/builder/combined/BaseConfigurationBuilderProvider.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/combined/BaseConfigurationBuilderProvider.html">
BaseConfigurationBuilderProvider</a></code> class. When creating an
instance the following information has to be passed:
<ul>
@@ -1147,9 +1147,9 @@ trigger.start();
<source><![CDATA[
ConfigurationProvider provider = new BaseConfigurationProvider(
/* normal builder */
- "org.apache.commons.configuration.builder.FileBasedConfigurationBuilder",
+ "org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder",
/* reloading builder */
- "org.apache.commons.configuration.builder.ReloadingFileBasedConfigurationBuilder",
+ "org.apache.commons.configuration2.builder.ReloadingFileBasedConfigurationBuilder",
/* configuration class */
"com.foo.MyConfig",
/* Parameters; here we assume that we have a custom parameters class
@@ -1200,8 +1200,8 @@ public class MyConfigurationBuilderProvi
{
public MyConfigurationBuilderProvider()
{
- super("org.apache.commons.configuration.builder.FileBasedConfigurationBuilder",
- "org.apache.commons.configuration.builder.ReloadingFileBasedConfigurationBuilder",
+ super("org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder",
+ "org.apache.commons.configuration2.builder.ReloadingFileBasedConfigurationBuilder",
"com.foo.MyConfig",
Collections.singleton(MyConfigParams.class.getName()));
}
@@ -1242,16 +1242,16 @@ CombinedConfiguration config = builder.g
The special parameters object for <code>CombinedConfigurationBuilder</code>
has already been mentioned and used within examples before. It can be obtained
from the <code>combined()</code> method of a
- <code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/Parameter.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/Parameter.html">
Parameters</a></code> instance. Its type is
- <code><a href="../apidocs/org/apache/commons/configuration/builder/fluent/CombinedBuilderParameters.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/fluent/CombinedBuilderParameters.html">
CombinedBuilderParameters</a></code>.
</p>
<p>
This type supports the settings common to all configurations. Additional
settings specific to <code>CombinedConfigurationBuilder</code> are
defined by the
- <code><a href="../apidocs/org/apache/commons/configuration/builder/CombinedBuilderProperties.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/CombinedBuilderProperties.html">
CombinedBuilderProperties</a></code> interface. This includes
<ul>
<li>the configuration builder for obtaining the definition configuration</li>
Modified: commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_combinedconfiguration.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_combinedconfiguration.xml?rev=1624753&r1=1624752&r2=1624753&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_combinedconfiguration.xml (original)
+++ commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_combinedconfiguration.xml Sat Sep 13 15:36:51 2014
@@ -26,10 +26,10 @@
<body>
<section name="Combined Configuration">
<p>
- The <code><a href="../apidocs/org/apache/commons/configuration/CombinedConfiguration.html">
+ The <code><a href="../apidocs/org/apache/commons/configuration2/CombinedConfiguration.html">
CombinedConfiguration</a></code> class provides an alternative for handling
multiple configuration sources. Its API is very similar to the
- <code><a href="../apidocs/org/apache/commons/configuration/CompositeConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/CompositeConfiguration.html">
CompositeConfiguration</a></code> class, which was discussed in the
<a href="howto_compositeconfiguration.html#Composite Configuration Details">previous
section</a>. There are the following differences however:
@@ -76,19 +76,19 @@
to re-construct the view.
</p>
</subsection>
-
+
<subsection name="Node combiners">
<p>
A <em>node combiner</em> is an object of a class that inherits from the
- abstract <code><a href="../apidocs/org/apache/commons/configuration/tree/NodeCombiner.html">NodeCombiner</a></code>
+ abstract <code><a href="../apidocs/org/apache/commons/configuration2/tree/NodeCombiner.html">NodeCombiner</a></code>
class. This class defines an abstract <code>combine()</code> method, which
takes the root nodes of two hierarchical configurations and returns the
root node of the combined node structure. It is up to a concrete
implementation how this combined structure will look like. <em>Commons
Configuration</em> ships with three concrete implementations
- <code><a href="../apidocs/org/apache/commons/configuration/tree/OverrideCombiner.html">OverrideCombiner</a></code>,
- <code><a href="../apidocs/org/apache/commons/configuration/tree/MergeCombiner.html">MergeCombiner</a></code>
- and <code><a href="../apidocs/org/apache/commons/configuration/tree/UnionCombiner.html">UnionCombiner</a></code>,
+ <code><a href="../apidocs/org/apache/commons/configuration2/tree/OverrideCombiner.html">OverrideCombiner</a></code>,
+ <code><a href="../apidocs/org/apache/commons/configuration2/tree/MergeCombiner.html">MergeCombiner</a></code>
+ and <code><a href="../apidocs/org/apache/commons/configuration2/tree/UnionCombiner.html">UnionCombiner</a></code>,
which implement an override, merge, and union semantics respectively.
</p>
<p>
@@ -736,7 +736,7 @@ cc.addConfiguration(builder2.getConfigur
Remember that a <code>CombinedConfiguration</code> is just a view over a
set of other configurations processed by a <code>NodeCombiner</code>. The
combiner sets up a nodes structure consisting of
- <code><a href="../apidocs/org/apache/commons/configuration/tree/ImmutableNode.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/tree/ImmutableNode.html">
ImmutableNode</a></code> objects. Some of these nodes are likely to be
shared with the child configurations. Because the nodes are immutable
updates on the combined configuration cause nodes to be replaced in the
Modified: commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_compositeconfiguration.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_compositeconfiguration.xml?rev=1624753&r1=1624752&r2=1624753&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_compositeconfiguration.xml (original)
+++ commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_compositeconfiguration.xml Sat Sep 13 15:36:51 2014
@@ -30,7 +30,7 @@
There are many use cases when you want to collect the properties
of several configuration sources and access them like a single
configuration object. One way to do that is using the
- <code><a href="../apidocs/org/apache/commons/configuration/CompositeConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/CompositeConfiguration.html">
CompositeConfiguration</a></code> class.
</p>
<p>
@@ -71,7 +71,7 @@ cc.addConfiguration(builderDefaults.getC
<subsection name="Saving Changes">
<p>
- If you have a non static Configuration where you want to
+ If you have a non static Configuration where you want to
save changes made to a configuration, and you are using a
CompositeConfiguration, then you will need to pass into
the constructor of the CompositeConfiguration what Configuration
Modified: commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_concurrency.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_concurrency.xml?rev=1624753&r1=1624752&r2=1624753&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_concurrency.xml (original)
+++ commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_concurrency.xml Sat Sep 13 15:36:51 2014
@@ -55,13 +55,13 @@
</p>
<p>
Objects implementing the <code>Configuration</code> interface can be
- associated with a
- <code><a href="../apidocs/org/apache/commons/configuration/sync/Synchronizer.html">
+ associated with a
+ <code><a href="../apidocs/org/apache/commons/configuration2/sync/Synchronizer.html">
Synchronizer</a></code> object. This synchronizer is triggered on each
access to the configuration (distinguishing between read and write
access). It can decide whether access is allowed or block the calling
thread until it is safe to continue. Per default, a Configuration object
- uses a <code><a href="../apidocs/org/apache/commons/configuration/sync/NoOpSynchronizer.html">
+ uses a <code><a href="../apidocs/org/apache/commons/configuration2/sync/NoOpSynchronizer.html">
NoOpSynchronizer</a></code> instance. As the name implies, this class does
nothing to protect its associated configuration against concurrent
access; its methods are just empty dummies. It is appropriate for use
@@ -71,7 +71,7 @@
If multiple threads are involved, Configuration objects have to be
thread-safe. For this purpose, there is another implementation of
<code>Synchronizer</code>:
- <code><a href="../apidocs/org/apache/commons/configuration/sync/ReadWriteSynchronizer.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/sync/ReadWriteSynchronizer.html">
ReadWriteSynchronizer</a></code>. This class is based on the
<code>ReentrantReadWriteLock</code> class from the JDK. It implements
the typical behavior desired when accessing a configuration in a
@@ -110,10 +110,10 @@ config.setSynchronizer(new ReadWriteSync
Some caveats are provided in the remaining of this chapter.
</p>
</subsection>
-
+
<subsection name="Basic operations and thread-safety">
<p>
- <code><a href="../apidocs/org/apache/commons/configuration/AbstractConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/AbstractConfiguration.html">
AbstractConfiguration</a></code> already provides a major part of the
implementation of correctly interacting with a <code>Synchronizer</code>
object. Methods for reading configuration data (such as
@@ -129,7 +129,7 @@ config.setSynchronizer(new ReadWriteSync
Classes derived from <code>AbstractConfiguration</code> sometimes offer
specific methods for accessing properties. For instance, hierarchical
configurations offer operations on whole subtrees, or
- <code><a href="../apidocs/org/apache/commons/configuration/INIConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/INIConfiguration.html">
INIConfiguration</a></code> allows querying specific sections. These
methods are also aware of the associated <code>Synchronizer</code> and
invoke it correctly.
@@ -139,7 +139,7 @@ config.setSynchronizer(new ReadWriteSync
object allowing direct control over the <code>Synchronizer</code>:
<code>lock()</code> and <code>unlock()</code>. Both methods expect an
argument of type
- <code><a href="../apidocs/org/apache/commons/configuration/sync/LockMode.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/sync/LockMode.html">
LockMode</a></code> which tells them whether the configuration is to be
locked for read or write access. These methods can be used to extend the
locking behavior of standard methods. For instance, if multiple properties
@@ -204,7 +204,7 @@ finally
used to do the change with a write lock held.
</p>
</subsection>
-
+
<subsection name="Special cases">
<p>
Thread-safety is certainly a complex topic. This section describes some
@@ -214,7 +214,7 @@ finally
<p>
<ul>
<li>All hierarchical configurations derived from
- <code><a href="../apidocs/org/apache/commons/configuration/BaseHierarchicalConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/BaseHierarchicalConfiguration.html">
BaseHierarchicalConfiguration</a></code> internally operate on a nodes
structure implemented by immutable nodes. This is beneficial for
concurrent access. It is even possible to share (sub) trees of
@@ -233,7 +233,7 @@ finally
configuration is empty now, it may be up for a surprise. In cases in
which the sequence of generated configuration events is important, a
fully functional synchronizer object should be set.</li>
- <li><code><a href="../apidocs/org/apache/commons/configuration/CombinedConfiguration.html">
+ <li><code><a href="../apidocs/org/apache/commons/configuration2/CombinedConfiguration.html">
CombinedConfiguration</a></code> is a bit special regarding lock
handling. Although derived from <code>BaseHierarchicalConfiguration</code>,
this class is not thread-safe per default. So if accessed by multiple
@@ -252,11 +252,11 @@ finally
children to a <code>CombinedConfiguration</code>, they can continue
using a <code>NoOpSynchronizer</code>.</li>
<li>Derived from <code>CombinedConfiguration</code> is
- <code><a href="../apidocs/org/apache/commons/configuration/DynamicCombinedConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/DynamicCombinedConfiguration.html">
DynamicCombinedConfiguration</a></code> which extends its base class by
the ability to manage multiple combined configuration instances. The
current instance is selected based on a key constructed by a
- <code><a href="../apidocs/org/apache/commons/configuration/interpol/ConfigurationInterpolator.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/interpol/ConfigurationInterpolator.html">
ConfigurationInterpolator</a></code> instance. If this yields a key
which has not been encountered before, a new <code>CombinedConfiguration</code>
object is created. Here again it turns out that even a read access to a
@@ -276,7 +276,7 @@ finally
multiple threads - provided that they are initialized in a safe way.
For the safe initialization of <code>Configuration</code> objects
specialized <a href="howto_builders.html">builders</a> are responsible. These are classes derived from
- <code><a href="../apidocs/org/apache/commons/configuration/builder/BasicConfigurationBuilder.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/BasicConfigurationBuilder.html">
BasicConfigurationBuilder</a></code>. Configuration builders are designed
to be thread-safe: their <code>getConfiguration()</code> method is
synchronized, so that configurations can be created and initialized in a
Modified: commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_events.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_events.xml?rev=1624753&r1=1624752&r2=1624753&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_events.xml (original)
+++ commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_events.xml Sat Sep 13 15:36:51 2014
@@ -39,7 +39,7 @@
<p>
In <em>Commons Configuration</em>, there is a central interface for all
objects that can generate events:
- <code><a href="../apidocs/org/apache/commons/configuration/event/EventSource.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/event/EventSource.html">
EventSource</a></code>. Here methods for adding and removing event listeners
are defined with the following signatures:
</p>
@@ -70,7 +70,7 @@
interface ensure a type-safe registration of event listeners. As we will
see in the next section, events are organized in a logic hierarchy. An
event listener has to implement the
- <code><a href="../apidocs/org/apache/commons/configuration/event/EventListener.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/event/EventListener.html">
EventListener</a></code> interface. This interface has a type parameter
for the event type which can be processed. The listener can process events
of this specific type and also events derived from this type. So listeners
@@ -107,7 +107,7 @@
<p>
All events generated by components in <em>Commons Configuration</em> are
derived from the
- <code><a href="../apidocs/org/apache/commons/configuration/event/Event.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/event/Event.html">
Event</a></code> class. This base class is pretty simple. It has a
property for the source - inherited from the <code>java.util.EventObject</code>
super class - and an event type. The event type can be used for instance
@@ -116,7 +116,7 @@
</p>
<p>
Event types are an interesting concept. They are represented by the
- <code><a href="../apidocs/org/apache/commons/configuration/event/EventType.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/event/EventType.html">
EventType</a></code> class. At first, an event type has a type parameter
which associates it with a specific event class. This parameter is checked
by the compiler to validate event listener registrations via the methods
@@ -178,9 +178,9 @@ config.addEventListener(ConfigurationEve
<subsection name="Configuration Update Events">
<p>
All configuration implementations derived from
- <code><a href="../apidocs/org/apache/commons/configuration/AbstractConfiguration.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/AbstractConfiguration.html">
AbstractConfiguration</a></code> can generate events of type
- <code><a href="../apidocs/org/apache/commons/configuration/event/ConfigurationEvent.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/event/ConfigurationEvent.html">
ConfigurationEvent</a></code> when they are manipulated. In addition to
the properties inherited from the <code>Event</code> base class, a
configuration event contains all information available about the
@@ -255,8 +255,8 @@ config.addEventListener(ConfigurationEve
configuration events to the console. The class could look as follows:
</p>
<source><![CDATA[
-import org.apache.commons.configuration.event.ConfigurationEvent;
-import org.apache.commons.configuration.event.EventListener;
+import org.apache.commons.configuration2.event.ConfigurationEvent;
+import org.apache.commons.configuration2.event.EventListener;
public class ConfigurationLogListener implements EventListener<ConfigurationEvent>
{
@@ -314,7 +314,7 @@ config.clearProperty("removedProperty");
Some implementations of the <code>Configuration</code> interface operate
on underlying storages that can throw exceptions on each property access.
As an example consider <code>
- <a href="../apidocs/org/apache/commons/configuration/DatabaseConfiguration.html">
+ <a href="../apidocs/org/apache/commons/configuration2/DatabaseConfiguration.html">
DatabaseConfiguration</a></code>: this configuration class issues an SQL
statement for each accessed property, which can potentially cause a
<code>SQLException</code>.
@@ -332,9 +332,9 @@ config.clearProperty("removedProperty");
<p>
When a configuration implementation encounters an exception on accessing
its data it generates an event of class
- <code><a href="../apidocs/org/apache/commons/configuration/event/ConfigurationErrorEvent.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/event/ConfigurationErrorEvent.html">
ConfigurationErrorEvent</a></code>. This event class has similar properties
- as <code><a href="../apidocs/org/apache/commons/configuration/event/ConfigurationEvent.html">
+ as <code><a href="../apidocs/org/apache/commons/configuration2/event/ConfigurationEvent.html">
ConfigurationEvent</a></code>. Especially the name and the value of the
property which was accessed when the error occurred can be retrieved.
In addition, there is the <code>getCause()</code> method which returns the
@@ -363,7 +363,7 @@ config.clearProperty("removedProperty");
</p>
<p>
We could now continue the example from the previous section and make our
- sample logging event listener also capable of tracing error events.
+ sample logging event listener also capable of tracing error events.
However, this would not earn us that much. There is no principle difference
in the handling of configuration update events and error events;
therefore, there is nothing new to learn. If the logging functionality
@@ -414,17 +414,17 @@ config.clearProperty("removedProperty");
</p>
<p>
For the events generated by a configuration builder a new event class is
- introduced: <code><a href="../apidocs/org/apache/commons/configuration/builder/ConfigurationBuilderEvent.html">
+ introduced: <code><a href="../apidocs/org/apache/commons/configuration2/builder/ConfigurationBuilderEvent.html">
ConfigurationBuilderEvent</a></code>. This class extends the base
- <code><a href="../apidocs/org/apache/commons/configuration/event/Event.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/event/Event.html">
Event</a></code> class, but does not define any new properties. However,
it overrides the <code>getSource()</code> method to return an instance
- of <code><a href="../apidocs/org/apache/commons/configuration/builder/ConfigurationBuilder.html">
+ of <code><a href="../apidocs/org/apache/commons/configuration2/builder/ConfigurationBuilder.html">
ConfigurationBuilder</a></code>. This event class is used to send
notifications which do not require additional information; the event itself
is sufficient to find out what has happened. Derived from
<code>ConfigurationBuilderEvent</code> is the
- <code><a href="../apidocs/org/apache/commons/configuration/builder/ConfigurationBuilderResultCreatedEvent.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/ConfigurationBuilderResultCreatedEvent.html">
ConfigurationBuilderResultCreatedEvent</a></code> event class. It is used
to indicate that a new managed configuration object was created. A
reference to this object can be queried using the
@@ -522,7 +522,7 @@ builder.addEventListener(ConfigurationEv
listeners. Configuration builders offer a fluent API for setting up
builder objects and setting required initialization parameters. This
also includes the registration of event listeners. For this purpose the
- <code><a href="../apidocs/org/apache/commons/configuration/builder/EventListenerParameters.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/builder/EventListenerParameters.html">
EventListenerParameters</a></code> class has been created. It allows setting an
arbitrary number of event listeners using method chaining. An instance
configured with the event listeners to be registered can then be passed
@@ -557,16 +557,16 @@ Configuration config = builder.getConfig
<subsection name="Reloading Events">
<p>
Another source of events is the
- <code><a href="../apidocs/org/apache/commons/configuration/reloading/ReloadingController.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/reloading/ReloadingController.html">
ReloadingController</a></code> class which was introduced in the chapter
<a href="howto_reloading.html">Automatic Reloading of Configuration Sources</a>.
A reloading controller generates events of type
- <code><a href="../apidocs/org/apache/commons/configuration/reloading/ReloadingEvent.html">
+ <code><a href="../apidocs/org/apache/commons/configuration2/reloading/ReloadingEvent.html">
ReloadingEvent</a></code> whenever it detects the need for a reloading
operation. Currently, there is only a single event type for reloading
events: <em>ReloadingEvent.ANY</em> which is directly derived from the
base type <em>Event.ANY</em>. The usage for registering listeners for
- this event is analogous to the other event sources covered so far.
+ this event is analogous to the other event sources covered so far.
</p>
<p>
In a typical usage scenario a mechanism is set up which periodically