You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2015/05/09 01:13:28 UTC

[5/6] incubator-tamaya git commit: Added builder example.

Added builder example.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/b92c57bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/b92c57bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/b92c57bc

Branch: refs/heads/master
Commit: b92c57bc1adee2e9ce8c9ee2a85992c33e8bf213
Parents: 6645aa2
Author: anatole <an...@apache.org>
Authored: Sat May 9 00:57:55 2015 +0200
Committer: anatole <an...@apache.org>
Committed: Sat May 9 00:57:55 2015 +0200

----------------------------------------------------------------------
 .../examples/builder/UsingABuilderExample.java  | 41 ++++++++++++++++++++
 1 file changed, 41 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b92c57bc/examples/7-builder-example/src/main/java/org/apache/tamaya/examples/builder/UsingABuilderExample.java
----------------------------------------------------------------------
diff --git a/examples/7-builder-example/src/main/java/org/apache/tamaya/examples/builder/UsingABuilderExample.java b/examples/7-builder-example/src/main/java/org/apache/tamaya/examples/builder/UsingABuilderExample.java
new file mode 100644
index 0000000..9817938
--- /dev/null
+++ b/examples/7-builder-example/src/main/java/org/apache/tamaya/examples/builder/UsingABuilderExample.java
@@ -0,0 +1,41 @@
+/*
+ * 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.tamaya.examples.builder;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.builder.ConfigurationBuilder;
+import org.apache.tamaya.resource.ConfigResources;
+
+
+/**
+ * Created by Anatole on 05.05.2015.
+ */
+public class UsingABuilderExample {
+
+    public static void main(String... args) {
+
+        ConfigurationBuilder builder = new ConfigurationBuilder();
+        Configuration config = builder.addPropertySources(ConfigResources.getResourceResolver().getResources("META-INF/boot/*.ini"))
+                .addPropertySources(ConfigResources.getResourceResolver().getResources("META-INF/config/*.properties"))
+                .enableProvidedPropertyConverters()
+                .enabledProvidedPropertyFilters()
+                .build();
+    }
+
+}