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 2012/10/03 21:15:27 UTC
svn commit: r1393690 - in
/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder:
./ ConfigurationBuilder.java
Author: oheger
Date: Wed Oct 3 19:15:27 2012
New Revision: 1393690
URL: http://svn.apache.org/viewvc?rev=1393690&view=rev
Log:
Added ConfigurationBuilder interface.
Added:
commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/
commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java (with props)
Added: 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=1393690&view=auto
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java (added)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java Wed Oct 3 19:15:27 2012
@@ -0,0 +1,50 @@
+/*
+ * 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;
+
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
+
+/**
+ * <p>
+ * Definition of an interface for objects that can create {@link Configuration}
+ * objects of a specific type.
+ * </p>
+ * <p>
+ * This interface defines an abstract way of creating a {@code Configuration}
+ * object. It does not assume any specific way of how this is done; this is
+ * completely in the responsibility of an implementation class. There is just a
+ * single method that returns the configuration constructed by this builder.
+ * </p>
+ *
+ * @version $Id$
+ * @since 2.0
+ * @param <T> the concrete type of the {@code Configuration} class produced by
+ * this builder
+ */
+public interface ConfigurationBuilder<T extends Configuration>
+{
+ /**
+ * Returns the configuration provided by this builder. An implementation has
+ * to perform all necessary steps for creating and initializing a
+ * {@code Configuration} object.
+ *
+ * @return the configuration
+ * @throws ConfigurationException if an error occurs
+ */
+ T getConfiguration() throws ConfigurationException;
+}
Propchange: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Re: svn commit: r1393690 - in /commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder:
./ ConfigurationBuilder.java
Posted by Matt Benson <gu...@gmail.com>.
On Wed, Oct 3, 2012 at 2:54 PM, Oliver Heger
<ol...@oliver-heger.de> wrote:
> Hi Matt,
>
> Am 03.10.2012 21:25, schrieb Matt Benson:
>
>> If [configuration] depends on [lang] already, presumably this new
>> version should depend on [lang] 3.x instead; in which case why not use
>> its Builder interface?
>
>
> Yes, we are going to switch to [lang] 3.x. I would like to use the Builder
> interface, but there are some open points:
>
> - Currently the builder method in ConfigurationBuilder throws a checked
> exception. It still has to be discussed whether in [configuration] 2.0
> checked exceptions should be replaced by runtime exceptions.
> - Switching the dependency to [lang] 3.x is one reason for a major release
> of [configuration]: Because classes of [lang] are exposed in the public API
> of [configuration], it is not possible to update the dependency in a binary
> compatible way. So it was said that such direct references should be avoided
> in future. I fear it would then not be possible to let classes in
> [configuration] implement an interface from [lang].
>
This last is sensible enough; thanks!
Matt
> Oliver
>
>>
>> $0.02,
>> Matt
>>
>> On Wed, Oct 3, 2012 at 2:15 PM, <oh...@apache.org> wrote:
>>>
>>> Author: oheger
>>> Date: Wed Oct 3 19:15:27 2012
>>> New Revision: 1393690
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1393690&view=rev
>>> Log:
>>> Added ConfigurationBuilder interface.
>>>
>>> Added:
>>>
>>> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/
>>>
>>> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
>>> (with props)
>>>
>>> Added:
>>> 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=1393690&view=auto
>>>
>>> ==============================================================================
>>> ---
>>> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
>>> (added)
>>> +++
>>> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
>>> Wed Oct 3 19:15:27 2012
>>> @@ -0,0 +1,50 @@
>>> +/*
>>> + * 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;
>>> +
>>> +import org.apache.commons.configuration.Configuration;
>>> +import org.apache.commons.configuration.ConfigurationException;
>>> +
>>> +/**
>>> + * <p>
>>> + * Definition of an interface for objects that can create {@link
>>> Configuration}
>>> + * objects of a specific type.
>>> + * </p>
>>> + * <p>
>>> + * This interface defines an abstract way of creating a {@code
>>> Configuration}
>>> + * object. It does not assume any specific way of how this is done; this
>>> is
>>> + * completely in the responsibility of an implementation class. There is
>>> just a
>>> + * single method that returns the configuration constructed by this
>>> builder.
>>> + * </p>
>>> + *
>>> + * @version $Id$
>>> + * @since 2.0
>>> + * @param <T> the concrete type of the {@code Configuration} class
>>> produced by
>>> + * this builder
>>> + */
>>> +public interface ConfigurationBuilder<T extends Configuration>
>>> +{
>>> + /**
>>> + * Returns the configuration provided by this builder. An
>>> implementation has
>>> + * to perform all necessary steps for creating and initializing a
>>> + * {@code Configuration} object.
>>> + *
>>> + * @return the configuration
>>> + * @throws ConfigurationException if an error occurs
>>> + */
>>> + T getConfiguration() throws ConfigurationException;
>>> +}
>>>
>>> Propchange:
>>> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
>>>
>>> ------------------------------------------------------------------------------
>>> svn:eol-style = native
>>>
>>> Propchange:
>>> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
>>>
>>> ------------------------------------------------------------------------------
>>> svn:keywords = Date Author Id Revision HeadURL
>>>
>>> Propchange:
>>> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
>>>
>>> ------------------------------------------------------------------------------
>>> svn:mime-type = text/plain
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: svn commit: r1393690 - in /commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder:
./ ConfigurationBuilder.java
Posted by Oliver Heger <ol...@oliver-heger.de>.
Hi Matt,
Am 03.10.2012 21:25, schrieb Matt Benson:
> If [configuration] depends on [lang] already, presumably this new
> version should depend on [lang] 3.x instead; in which case why not use
> its Builder interface?
Yes, we are going to switch to [lang] 3.x. I would like to use the
Builder interface, but there are some open points:
- Currently the builder method in ConfigurationBuilder throws a checked
exception. It still has to be discussed whether in [configuration] 2.0
checked exceptions should be replaced by runtime exceptions.
- Switching the dependency to [lang] 3.x is one reason for a major
release of [configuration]: Because classes of [lang] are exposed in the
public API of [configuration], it is not possible to update the
dependency in a binary compatible way. So it was said that such direct
references should be avoided in future. I fear it would then not be
possible to let classes in [configuration] implement an interface from
[lang].
Oliver
>
> $0.02,
> Matt
>
> On Wed, Oct 3, 2012 at 2:15 PM, <oh...@apache.org> wrote:
>> Author: oheger
>> Date: Wed Oct 3 19:15:27 2012
>> New Revision: 1393690
>>
>> URL: http://svn.apache.org/viewvc?rev=1393690&view=rev
>> Log:
>> Added ConfigurationBuilder interface.
>>
>> Added:
>> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/
>> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java (with props)
>>
>> Added: 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=1393690&view=auto
>> ==============================================================================
>> --- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java (added)
>> +++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java Wed Oct 3 19:15:27 2012
>> @@ -0,0 +1,50 @@
>> +/*
>> + * 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;
>> +
>> +import org.apache.commons.configuration.Configuration;
>> +import org.apache.commons.configuration.ConfigurationException;
>> +
>> +/**
>> + * <p>
>> + * Definition of an interface for objects that can create {@link Configuration}
>> + * objects of a specific type.
>> + * </p>
>> + * <p>
>> + * This interface defines an abstract way of creating a {@code Configuration}
>> + * object. It does not assume any specific way of how this is done; this is
>> + * completely in the responsibility of an implementation class. There is just a
>> + * single method that returns the configuration constructed by this builder.
>> + * </p>
>> + *
>> + * @version $Id$
>> + * @since 2.0
>> + * @param <T> the concrete type of the {@code Configuration} class produced by
>> + * this builder
>> + */
>> +public interface ConfigurationBuilder<T extends Configuration>
>> +{
>> + /**
>> + * Returns the configuration provided by this builder. An implementation has
>> + * to perform all necessary steps for creating and initializing a
>> + * {@code Configuration} object.
>> + *
>> + * @return the configuration
>> + * @throws ConfigurationException if an error occurs
>> + */
>> + T getConfiguration() throws ConfigurationException;
>> +}
>>
>> Propchange: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
>> ------------------------------------------------------------------------------
>> svn:eol-style = native
>>
>> Propchange: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
>> ------------------------------------------------------------------------------
>> svn:keywords = Date Author Id Revision HeadURL
>>
>> Propchange: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
>> ------------------------------------------------------------------------------
>> svn:mime-type = text/plain
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: svn commit: r1393690 - in /commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder:
./ ConfigurationBuilder.java
Posted by Matt Benson <gu...@gmail.com>.
If [configuration] depends on [lang] already, presumably this new
version should depend on [lang] 3.x instead; in which case why not use
its Builder interface?
$0.02,
Matt
On Wed, Oct 3, 2012 at 2:15 PM, <oh...@apache.org> wrote:
> Author: oheger
> Date: Wed Oct 3 19:15:27 2012
> New Revision: 1393690
>
> URL: http://svn.apache.org/viewvc?rev=1393690&view=rev
> Log:
> Added ConfigurationBuilder interface.
>
> Added:
> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/
> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java (with props)
>
> Added: 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=1393690&view=auto
> ==============================================================================
> --- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java (added)
> +++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java Wed Oct 3 19:15:27 2012
> @@ -0,0 +1,50 @@
> +/*
> + * 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;
> +
> +import org.apache.commons.configuration.Configuration;
> +import org.apache.commons.configuration.ConfigurationException;
> +
> +/**
> + * <p>
> + * Definition of an interface for objects that can create {@link Configuration}
> + * objects of a specific type.
> + * </p>
> + * <p>
> + * This interface defines an abstract way of creating a {@code Configuration}
> + * object. It does not assume any specific way of how this is done; this is
> + * completely in the responsibility of an implementation class. There is just a
> + * single method that returns the configuration constructed by this builder.
> + * </p>
> + *
> + * @version $Id$
> + * @since 2.0
> + * @param <T> the concrete type of the {@code Configuration} class produced by
> + * this builder
> + */
> +public interface ConfigurationBuilder<T extends Configuration>
> +{
> + /**
> + * Returns the configuration provided by this builder. An implementation has
> + * to perform all necessary steps for creating and initializing a
> + * {@code Configuration} object.
> + *
> + * @return the configuration
> + * @throws ConfigurationException if an error occurs
> + */
> + T getConfiguration() throws ConfigurationException;
> +}
>
> Propchange: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
> ------------------------------------------------------------------------------
> svn:eol-style = native
>
> Propchange: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
> ------------------------------------------------------------------------------
> svn:keywords = Date Author Id Revision HeadURL
>
> Propchange: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/ConfigurationBuilder.java
> ------------------------------------------------------------------------------
> svn:mime-type = text/plain
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org