You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by pl...@apache.org on 2015/03/09 00:20:24 UTC
incubator-tamaya git commit: TAMAYA-60 Started to overhaul the
JavaDoc for the ConfigurationBuilder.
Repository: incubator-tamaya
Updated Branches:
refs/heads/master c7eb17766 -> 0d83a6fe8
TAMAYA-60 Started to overhaul the JavaDoc for the ConfigurationBuilder.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/0d83a6fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/0d83a6fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/0d83a6fe
Branch: refs/heads/master
Commit: 0d83a6fe88bb6d6b6e1187db5d4f81b1760c04c9
Parents: c7eb177
Author: Oliver B. Fischer <pl...@apache.org>
Authored: Mon Mar 9 00:20:01 2015 +0100
Committer: Oliver B. Fischer <pl...@apache.org>
Committed: Mon Mar 9 00:20:01 2015 +0100
----------------------------------------------------------------------
.../modules/builder/ConfigurationBuilder.java | 37 ++++++++++++++++++--
1 file changed, 34 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0d83a6fe/modules/builder/src/main/java/org/apache/tamaya/modules/builder/ConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/modules/builder/src/main/java/org/apache/tamaya/modules/builder/ConfigurationBuilder.java b/modules/builder/src/main/java/org/apache/tamaya/modules/builder/ConfigurationBuilder.java
index f680e21..01180d0 100644
--- a/modules/builder/src/main/java/org/apache/tamaya/modules/builder/ConfigurationBuilder.java
+++ b/modules/builder/src/main/java/org/apache/tamaya/modules/builder/ConfigurationBuilder.java
@@ -63,7 +63,29 @@ import static java.lang.String.format;
*/
/**
- * Builder that allows to build a Configuration completely manually.
+ * <p>Builder class used for building a configuration manually without relying
+ * only on the Service Provider Interface API.</p>
+ *
+ * <p><strong>Features of the builder</strong></p>
+ *
+ * <ol>
+ * <li>Adding of property converters manually</li>
+ * <li>Adding of property sources directly</li>
+ * <li>Adding of property sources via URL</li>
+ * <li>Adding of property source providers directly</li>
+ * <li>Enabling and disabling of via SPI mechanism provided resources as converters,
+ * property sources, etc.</li>
+ * </ol>
+ *
+ * <p><strong>Example</strong></p>
+ *
+ * <pre>{@code ConfigurationBuilder builder = new ConfigurationBuilder();
+ * builder.disableProvidedPropertySources() // Do not load provided property
+ * .disableProvidedPropertySourceProviders() // sources and providers automatically
+ * .addPropertySource("file:/etc/conf.properties"); // Load properties from conf.properties
+ *
+ * Configuration config = builder.build();
+ * }</pre>
*/
public class ConfigurationBuilder {
/** Builder used to create new ConfigurationContext instances. */
@@ -307,6 +329,13 @@ public class ConfigurationBuilder {
return this;
}
+ /**
+ * Checks if the automatic loading of {@link org.apache.tamaya.spi.PropertySourceProvider
+ * PropertySourceProviders} is enabled or disabled.
+ *
+ * @return {@code true} if the automatic loading is enabled,
+ * otherwise {@code false}.
+ */
public boolean isPropertySourceProvidersLoadingEnabled() {
return loadProvidedPropertySourceProviders;
}
@@ -316,8 +345,10 @@ public class ConfigurationBuilder {
/**
- * Creates a new Configuration instance based on the configured data.
- * @return a new Configuration instance.
+ * Builds a new configuration based on the configuration of this builder instance.
+ *
+ * @return a new {@link org.apache.tamaya.Configuration configuration instance},
+ * never {@code null}.
*/
public Configuration build() {
checkBuilderState();