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/08/17 10:10:17 UTC

[1/3] incubator-tamaya git commit: Fixed typos. Added additional params for disablement.

Repository: incubator-tamaya
Updated Branches:
  refs/heads/master defad3c88 -> 069ec3667


Fixed typos.
Added additional params for disablement.


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

Branch: refs/heads/master
Commit: 56d86eee79e2bfcf347462c0b2e8fec41d2bc742
Parents: 0a8226a
Author: anatole <an...@apache.org>
Authored: Mon Aug 17 09:53:59 2015 +0200
Committer: anatole <an...@apache.org>
Committed: Mon Aug 17 10:09:58 2015 +0200

----------------------------------------------------------------------
 .../model/internal/ConfiguredInlineModelProviderSpi.java  |  4 ++--
 .../ConfiguredPropertiesValidationProviderSpi.java        | 10 ++++++++++
 .../java/org/apache/tamaya/model/ValidationTests.java     |  2 +-
 3 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/56d86eee/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java b/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java
index 614346f..88f254f 100644
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java
+++ b/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java
@@ -50,8 +50,8 @@ public class ConfiguredInlineModelProviderSpi implements ValidationProviderSpi {
      */
     public ConfiguredInlineModelProviderSpi() {
         String enabledVal = ConfigurationProvider.getConfiguration().get(MODEL_EANABLED_PARAM);
-        boolean disabled = enabledVal==null? true: "false".equalsIgnoreCase(enabledVal);
-        if (!disabled) {
+        boolean enabled = enabledVal==null? true: "true".equalsIgnoreCase(enabledVal);
+        if (enabled) {
             LOG.info("Reading model configuration from config...");
             Map<String,String> config = ConfigurationProvider.getConfiguration().getProperties();
             validations.addAll(ConfigValidationsReader.loadValidations(config,

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/56d86eee/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesValidationProviderSpi.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesValidationProviderSpi.java b/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesValidationProviderSpi.java
index 4bbfbd1..6eb64aa 100644
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesValidationProviderSpi.java
+++ b/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesValidationProviderSpi.java
@@ -1,5 +1,6 @@
 package org.apache.tamaya.model.internal;
 
+import org.apache.tamaya.ConfigurationProvider;
 import org.apache.tamaya.model.Validation;
 import org.apache.tamaya.model.spi.AreaValidation;
 import org.apache.tamaya.model.spi.ConfigValidationsReader;
@@ -97,11 +98,20 @@ public class ConfiguredPropertiesValidationProviderSpi implements ValidationProv
 
     /** The logger. */
     private static final Logger LOG = Logger.getLogger(ConfiguredPropertiesValidationProviderSpi.class.getName());
+    /** parameter to disable this provider. By default the provider is active. */
+    private static final String MODEL_EANABLED_PARAM = "org.apache.tamaya.model.default.enabled";
     /** The validations read. */
     private List<Validation> validations = new ArrayList<>();
 
     public ConfiguredPropertiesValidationProviderSpi() {
+        String enabledVal = ConfigurationProvider.getConfiguration().get(MODEL_EANABLED_PARAM);
+        boolean enabled = enabledVal==null? true: "true".equalsIgnoreCase(enabledVal);
+        if(!enabled){
+            LOG.info("Reading model data from META-INF/configmodel.properties has been disabled.");
+            return;
+        }
         try {
+            LOG.info("Reading model data from META-INF/configmodel.properties...");
             Enumeration<URL> configs = getClass().getClassLoader().getResources("META-INF/configmodel.properties");
             while (configs.hasMoreElements()) {
                 URL config = configs.nextElement();

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/56d86eee/sandbox/model/src/test/java/org/apache/tamaya/model/ValidationTests.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/test/java/org/apache/tamaya/model/ValidationTests.java b/sandbox/model/src/test/java/org/apache/tamaya/model/ValidationTests.java
index 29c8328..dd8a829 100644
--- a/sandbox/model/src/test/java/org/apache/tamaya/model/ValidationTests.java
+++ b/sandbox/model/src/test/java/org/apache/tamaya/model/ValidationTests.java
@@ -19,6 +19,6 @@ public class ValidationTests {
 
     @Test
     public void testAllValidationsInclUndefined(){
-        System.err.println("Inclusing UNDEFINED: \n" + ConfigValidator.validate(true));
+        System.err.println("Including UNDEFINED: \n" + ConfigValidator.validate(true));
     }
 }


[2/3] incubator-tamaya git commit: Unified model metadata. Simplified implementation.

Posted by an...@apache.org.
Unified model metadata.
Simplified implementation.


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

Branch: refs/heads/master
Commit: 0a8226a82333fb35c1a6f4c34c28fdbb4eaa992b
Parents: defad3c
Author: anatole <an...@apache.org>
Authored: Mon Aug 17 09:04:34 2015 +0200
Committer: anatole <an...@apache.org>
Committed: Mon Aug 17 10:09:58 2015 +0200

----------------------------------------------------------------------
 sandbox/model/pom.xml                           |  14 ++
 .../ConfiguredInlineModelProviderSpi.java       |  68 +++++++
 ...nfiguredPropertiesValidationProviderSpi.java | 129 +++++++++++++
 .../ConfiguredResourcesModelProviderSpi.java    | 125 ++++++++++++
 .../ConfiguredValidationProviderSpi.java        | 188 -------------------
 .../model/spi/ConfigValidationsReader.java      | 169 +++++++++++++++++
 ...pache.tamaya.model.spi.ValidationProviderSpi |   4 +-
 .../resources/META-INF/configmodel.properties   |  96 ++++++++++
 .../META-INF/configmodel/configmodel.properties |  96 ----------
 .../src/test/resources/examples/configmodel.ini |  37 +---
 .../test/resources/examples/configmodel.json    | 147 +++++++--------
 .../resources/examples/configmodel.properties   |  81 ++++----
 .../src/test/resources/examples/configmodel.xml | 130 +++++++------
 .../test/resources/examples/configmodel.yaml    |  74 +++++---
 14 files changed, 834 insertions(+), 524 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0a8226a8/sandbox/model/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/model/pom.xml b/sandbox/model/pom.xml
index 29484d9..92acf9b 100644
--- a/sandbox/model/pom.xml
+++ b/sandbox/model/pom.xml
@@ -48,6 +48,20 @@ under the License.
             <scope>Test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.tamaya.ext</groupId>
+            <artifactId>tamaya-formats</artifactId>
+            <version>0.1-incubating-SNAPSHOT</version>
+            <scope>provided</scope>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tamaya.ext</groupId>
+            <artifactId>tamaya-json</artifactId>
+            <version>0.1-incubating-SNAPSHOT</version>
+            <scope>provided</scope>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
         </dependency>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0a8226a8/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java b/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java
new file mode 100644
index 0000000..614346f
--- /dev/null
+++ b/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java
@@ -0,0 +1,68 @@
+/*
+ * 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.model.internal;
+
+import org.apache.tamaya.ConfigurationProvider;
+import org.apache.tamaya.model.Validation;
+import org.apache.tamaya.model.spi.ConfigValidationsReader;
+import org.apache.tamaya.model.spi.ValidationProviderSpi;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+
+/**
+ * Validation provider that reads model metadata from the current {@link org.apache.tamaya.Configuration}.
+ */
+public class ConfiguredInlineModelProviderSpi implements ValidationProviderSpi {
+
+    /** The logger. */
+    private static final Logger LOG = Logger.getLogger(ConfiguredInlineModelProviderSpi.class.getName());
+    /** parameter to disable this provider. By default the provider is active. */
+    private static final String MODEL_EANABLED_PARAM = "org.apache.tamaya.model.integrated.enabled";
+
+    /** The validations read. */
+    private List<Validation> validations = new ArrayList<>();
+
+
+    /**
+     * Constructor, typically called by the {@link java.util.ServiceLoader}.
+     */
+    public ConfiguredInlineModelProviderSpi() {
+        String enabledVal = ConfigurationProvider.getConfiguration().get(MODEL_EANABLED_PARAM);
+        boolean disabled = enabledVal==null? true: "false".equalsIgnoreCase(enabledVal);
+        if (!disabled) {
+            LOG.info("Reading model configuration from config...");
+            Map<String,String> config = ConfigurationProvider.getConfiguration().getProperties();
+            validations.addAll(ConfigValidationsReader.loadValidations(config,
+                    "<Inline Configuration Model>"));
+        }
+        validations = Collections.unmodifiableList(validations);
+    }
+
+
+    @Override
+    public Collection<Validation> getValidations() {
+        return validations;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0a8226a8/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesValidationProviderSpi.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesValidationProviderSpi.java b/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesValidationProviderSpi.java
new file mode 100644
index 0000000..4bbfbd1
--- /dev/null
+++ b/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesValidationProviderSpi.java
@@ -0,0 +1,129 @@
+package org.apache.tamaya.model.internal;
+
+import org.apache.tamaya.model.Validation;
+import org.apache.tamaya.model.spi.AreaValidation;
+import org.apache.tamaya.model.spi.ConfigValidationsReader;
+import org.apache.tamaya.model.spi.ParameterValidation;
+import org.apache.tamaya.model.spi.ValidationProviderSpi;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Validation provider that reads model metadata from property files from
+ * {@code classpath*:META-INF/configmodel.properties} in the following format:
+ * <pre>
+ * ###################################################################################
+ * # Example of a configuration metamodel expressed via properties.
+ * ####################################################################################
+ *
+ * # Metamodel information
+ * [model].provider=ConfigModel Extension
+ *
+ * ####################################################################################
+ * # Description of Configuration Sections (minimal, can be extended by other modules).
+ * # By default its interpreted as a section !
+ * ####################################################################################
+ *
+ * # a (section)
+ * {model}a.class=Section
+ * {model}a.params2.class=Parameter
+ * {model}a.params2.type=String
+ * {model}a.params2.required=true
+ * {model}a.params2.description=a required parameter
+ *
+ * {model}a.paramInt.class=Parameter
+ * {model}a.paramInt.ref=MyNumber
+ * {model}a.paramInt.description=an optional parameter (default)
+ *
+ * {model}a._number.class=Parameter
+ * {model}a._number.type=Integer
+ * {model}a._number.deprecated=true
+ * {model}a._number.mappedTo=a.paramInt
+ *
+ * # a.b.c (section)
+ * {model}a.b.c.class=Section
+ * {model}a.b.c.description=Just a test section
+ *
+ * # a.b.c.aRequiredSection (section)
+ * {model}a.b.c.aRequiredSection.class=Section
+ * {model}a.b.c.aRequiredSection.required=true
+ * {model}a.b.c.aRequiredSection.description=A section containing required parameters is called a required section.\
+ * Sections can also explicitly be defined to be required, but without\
+ * specifying the paramteres to be contained.,
+ *
+ * # a.b.c.aRequiredSection.subsection (section)
+ * {model}a.b.c.aRequiredSection.subsection.class=Section
+ *
+ * {model}a.b.c.aRequiredSection.subsection.param0.class=Parameter
+ * {model}a.b.c.aRequiredSection.subsection.param0.type=String
+ * {model}a.b.c.aRequiredSection.subsection.param0.description=a minmally documented String parameter
+ * # A minmal String parameter
+ * {model}a.b.c.aRequiredSection.subsection.param00.class=Parameter
+ * {model}a.b.c.aRequiredSection.subsection.param00.type=String
+ *
+ * # a.b.c.aRequiredSection.subsection (section)
+ * {model}a.b.c.aRequiredSection.subsection.param1.class=Parameter
+ * {model}a.b.c.aRequiredSection.subsection.param1.type = String
+ * {model}a.b.c.aRequiredSection.subsection.param1.required = true
+ * {model}a.b.c.aRequiredSection.subsection.intParam.class=Parameter
+ * {model}a.b.c.aRequiredSection.subsection.intParam.type = Integer
+ * {model}a.b.c.aRequiredSection.subsection.intParam.description=an optional parameter (default)
+ *
+ * # a.b.c.aRequiredSection.nonempty-subsection (section)
+ * {model}a.b.c.aRequiredSection.nonempty-subsection.class=Section
+ * {model}a.b.c.aRequiredSection.nonempty-subsection.required=true
+ *
+ * # a.b.c.aRequiredSection.optional-subsection (section)
+ * {model}a.b.c.aRequiredSection.optional-subsection.class=Section
+ *
+ * # a.b.c.aValidatedSection (section)
+ * {model}a.b.c.aValidatedSection.class=Section
+ * {model}a.b.c.aValidatedSection.description=A validated section.
+ * {model}a.b.c.aValidatedSection.validations=org.apache.tamaya.model.TestValidator
+ * </pre>
+ */
+public class ConfiguredPropertiesValidationProviderSpi implements ValidationProviderSpi {
+
+    /** The logger. */
+    private static final Logger LOG = Logger.getLogger(ConfiguredPropertiesValidationProviderSpi.class.getName());
+    /** The validations read. */
+    private List<Validation> validations = new ArrayList<>();
+
+    public ConfiguredPropertiesValidationProviderSpi() {
+        try {
+            Enumeration<URL> configs = getClass().getClassLoader().getResources("META-INF/configmodel.properties");
+            while (configs.hasMoreElements()) {
+                URL config = configs.nextElement();
+                try (InputStream is = config.openStream()) {
+                    Properties props = new Properties();
+                    props.load(is);
+                    validations.addAll(ConfigValidationsReader.loadValidations(props, config.toString()));
+                } catch (Exception e) {
+                    Logger.getLogger(getClass().getName()).log(Level.SEVERE,
+                            "Error loading config metadata from " + config, e);
+                }
+            }
+        } catch (Exception e) {
+            LOG.log(Level.SEVERE,
+                    "Error loading config metadata from META-INF/configmodel.properties", e);
+        }
+        validations = Collections.unmodifiableList(validations);
+    }
+
+
+    @Override
+    public Collection<Validation> getValidations() {
+        return validations;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0a8226a8/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredResourcesModelProviderSpi.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredResourcesModelProviderSpi.java b/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredResourcesModelProviderSpi.java
new file mode 100644
index 0000000..1eb7cc5
--- /dev/null
+++ b/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredResourcesModelProviderSpi.java
@@ -0,0 +1,125 @@
+package org.apache.tamaya.model.internal;
+
+import org.apache.tamaya.ConfigurationProvider;
+import org.apache.tamaya.format.ConfigurationData;
+import org.apache.tamaya.format.ConfigurationFormats;
+import org.apache.tamaya.model.Validation;
+import org.apache.tamaya.model.spi.AreaValidation;
+import org.apache.tamaya.model.spi.ConfigValidationsReader;
+import org.apache.tamaya.model.spi.ParameterValidation;
+import org.apache.tamaya.model.spi.ValidationProviderSpi;
+import org.apache.tamaya.resource.ConfigResources;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Validation provider that reads model metadata from property files from
+ * {@code classpath*:META-INF/configmodel.json} in the following format:
+ * <pre>
+ * </pre>
+ */
+public class ConfiguredResourcesModelProviderSpi implements ValidationProviderSpi {
+
+    /** The logger. */
+    private static final Logger LOG = Logger.getLogger(ConfiguredResourcesModelProviderSpi.class.getName());
+    /** The parameter that can be used to configure the location of the configuration model resources. */
+    private static final String MODEL_RESOURCE_PARAM = "org.apache.tamaya.model.resources";
+    /** The resource class to checked for testing the availability of the resources extension module. */
+    private static final String CONFIG_RESOURCE_CLASS = "org.apache.tamaya.resource.ConfigResource";
+    /** The resource class to checked for testing the availability of the formats extension module. */
+    private static final String CONFIGURATION_FORMATS_CLASS = "org.apache.tamaya.format.ConfigurationFormats";
+    /** Initializes the flag showing if the formats module is present (required). */
+    private static boolean available = checkAvailabilityFormats();
+    /** Initializes the flag showing if the resources module is present (optional). */
+    private static boolean resourcesExtensionAvailable = checkAvailabilityResources();
+
+    /** The validations read. */
+    private List<Validation> validations = new ArrayList<>();
+
+    /** Initializes the flag showing if the formats module is present (required). */
+    private static boolean checkAvailabilityFormats() {
+        try {
+            Class.forName(CONFIGURATION_FORMATS_CLASS);
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    /** Initializes the flag showing if the resources module is present (optional). */
+    private static boolean checkAvailabilityResources() {
+        try {
+            Class.forName(CONFIG_RESOURCE_CLASS);
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    /**
+     * Constructor, mostly called from {@link java.util.ServiceLoader}
+     */
+    public ConfiguredResourcesModelProviderSpi() {
+        if (!available) {
+            LOG.info("tamaya-format extension is required to read model configuration, No extended model support available.");
+        } else {
+            String resources = ConfigurationProvider.getConfiguration().get(MODEL_RESOURCE_PARAM);
+            if(resources==null || resources.trim().isEmpty()){
+                LOG.info("Mo model resources location configured in " + MODEL_RESOURCE_PARAM + ".");
+                return;
+            }
+            Collection<URL> urls = new ArrayList<>();
+            if(resourcesExtensionAvailable){
+                LOG.info("Using tamaya-resources extension to read model configuration from " + resources);
+                urls = ConfigResources.getResourceResolver().getResources(resources.split(","));
+            }
+            else{
+                LOG.info("Using default classloader resource location to read model configuration from " + resources);
+                urls = new ArrayList<>();
+                for(String resource:resources.split(",")){
+                    if(!resource.trim().isEmpty()){
+                        Enumeration<URL> configs = null;
+                        try {
+                            configs = getClass().getClassLoader().getResources(resource);
+                            while (configs.hasMoreElements()) {
+                                urls.add(configs.nextElement());
+                            }
+                        } catch (IOException e) {
+                            Logger.getLogger(getClass().getName()).log(Level.SEVERE,
+                                    "Error evaluating config model locations from "+resource, e);
+                        }
+                    }
+                }
+            }
+            // Reading configs
+            for(URL config:urls){
+                try (InputStream is = config.openStream()) {
+                    ConfigurationData data = ConfigurationFormats.readConfigurationData(config);
+                    validations.addAll(ConfigValidationsReader.loadValidations(data.getCombinedProperties(), config.toString()));
+                } catch (Exception e) {
+                    Logger.getLogger(getClass().getName()).log(Level.SEVERE,
+                            "Error loading config model data from " + config, e);
+                }
+            }
+        }
+        validations = Collections.unmodifiableList(validations);
+    }
+
+
+    @Override
+    public Collection<Validation> getValidations() {
+        return validations;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0a8226a8/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredValidationProviderSpi.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredValidationProviderSpi.java b/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredValidationProviderSpi.java
deleted file mode 100644
index a3f77b8..0000000
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredValidationProviderSpi.java
+++ /dev/null
@@ -1,188 +0,0 @@
-package org.apache.tamaya.model.internal;
-
-import org.apache.tamaya.model.Validation;
-import org.apache.tamaya.model.spi.AreaValidation;
-import org.apache.tamaya.model.spi.ParameterValidation;
-import org.apache.tamaya.model.spi.ValidationProviderSpi;
-
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Validation provider that reads model metadata from property files with the following format:
- * <pre>
- * ###################################################################################
- * # Example of a configuration metamodel expressed via properties.
- * ####################################################################################
- *
- * # Metamodel information
- * [model].provider=ConfigModel Extension
- *
- * # reusable parameter definition, referenceable as MyNumber
- * [MyNumber].class=Parameter
- * [MyNumber].type=Integer
- * [MyNumber].description=a (reusable) number type parameter (optional)
- *
- * ####################################################################################
- * # Description of Configuration Sections (minimal, can be extended by other modules).
- * # By default its interpreted as a section !
- * ####################################################################################
- *
- * # a (section)
- * a.class=Section
- * a.params2.class=Parameter
- * a.params2.type=String
- * a.params2.required=true
- * a.params2.description=a required parameter
- *
- * a.paramInt.class=Parameter
- * a.paramInt.ref=MyNumber
- * a.paramInt.description=an optional parameter (default)
- *
- * a._number.class=Parameter
- * a._number.type=Integer
- * a._number.deprecated=true
- * a._number.mappedTo=a.paramInt
- *
- * # a.b.c (section)
- * a.b.c.class=Section
- * a.b.c.description=Just a test section
- *
- * # a.b.c.aRequiredSection (section)
- * a.b.c.aRequiredSection.class=Section
- * a.b.c.aRequiredSection.required=true
- * a.b.c.aRequiredSection.description=A section containing required parameters is called a required section.\
- * Sections can also explicitly be defined to be required, but without\
- * specifying the paramteres to be contained.,
- *
- * # a.b.c.aRequiredSection.subsection (section)
- * a.b.c.aRequiredSection.subsection.class=Section
- *
- * a.b.c.aRequiredSection.subsection.param0.class=Parameter
- * a.b.c.aRequiredSection.subsection.param0.type=String
- * a.b.c.aRequiredSection.subsection.param0.description=a minmally documented String parameter
- * # A minmal String parameter
- * a.b.c.aRequiredSection.subsection.param00.class=Parameter
- * a.b.c.aRequiredSection.subsection.param00.type=String
- *
- * # a.b.c.aRequiredSection.subsection (section)
- * a.b.c.aRequiredSection.subsection.param1.class=Parameter
- * a.b.c.aRequiredSection.subsection.param1.type = String
- * a.b.c.aRequiredSection.subsection.param1.required = true
- * a.b.c.aRequiredSection.subsection.intParam.class=Parameter
- * a.b.c.aRequiredSection.subsection.intParam.type = Integer
- * a.b.c.aRequiredSection.subsection.intParam.description=an optional parameter (default)
- *
- * # a.b.c.aRequiredSection.nonempty-subsection (section)
- * a.b.c.aRequiredSection.nonempty-subsection.class=Section
- * a.b.c.aRequiredSection.nonempty-subsection.required=true
- *
- * # a.b.c.aRequiredSection.optional-subsection (section)
- * a.b.c.aRequiredSection.optional-subsection.class=Section
- *
- * # a.b.c.aValidatedSection (section)
- * a.b.c.aValidatedSection.class=Section
- * a.b.c.aValidatedSection.description=A validated section.
- * a.b.c.aValidatedSection.validations=org.apache.tamaya.model.TestValidator
- * </pre>
- */
-public class ConfiguredValidationProviderSpi implements ValidationProviderSpi {
-
-    private List<Validation> validations = new ArrayList<>();
-
-    public ConfiguredValidationProviderSpi() {
-        try {
-            Enumeration<URL> configs = getClass().getClassLoader().getResources("META-INF/configmodel/configmodel.properties");
-            while (configs.hasMoreElements()) {
-                URL config = configs.nextElement();
-                try (InputStream is = config.openStream()) {
-                    Properties props = new Properties();
-                    props.load(is);
-                    loadValidations(props, config.toString());
-                } catch (Exception e) {
-                    Logger.getLogger(getClass().getName()).log(Level.SEVERE,
-                            "Error loading config metadata from " + config, e);
-                }
-            }
-        } catch (Exception e) {
-            Logger.getLogger(getClass().getName()).log(Level.SEVERE,
-                    "Error loading config metadata from META-INF/configmodel/configmodel.properties", e);
-        }
-        validations = Collections.unmodifiableList(validations);
-    }
-
-    private void loadValidations(Properties props, String resource) {
-        String provider = props.getProperty("[model].provider");
-        if (provider == null) {
-            provider = resource;
-        }
-        Set<String> itemKeys = new HashSet<>();
-        for (Object key : props.keySet()) {
-            if (key.toString().endsWith(".class")) {
-                itemKeys.add(key.toString().substring(0, key.toString().length() - ".class".length()));
-            }
-        }
-        for (String baseKey : itemKeys) {
-            String clazz = props.getProperty(baseKey + ".class");
-            String type = props.getProperty(baseKey + ".type");
-            if(type==null){
-                type = String.class.getName();
-            }
-            String description = props.getProperty(baseKey + ".description");
-            String regEx = props.getProperty(baseKey + ".expression");
-            String validations = props.getProperty(baseKey + ".validations");
-            String requiredVal = props.getProperty(baseKey + ".required");
-            if ("Parameter".equalsIgnoreCase(clazz)) {
-                initParameter(baseKey, description, type, requiredVal, regEx, validations);
-            } else if ("Section".equalsIgnoreCase(clazz)) {
-                initSection(baseKey, description, requiredVal, validations);
-            }
-        }
-    }
-
-    private void initParameter(String name, String desc, String type, String reqVal, String regEx, String validations) {
-        boolean required = "true".equalsIgnoreCase(reqVal);
-        ParameterValidation.Builder builder = ParameterValidation.builder(name).setRequired(required)
-                .setDescription(desc).setExpression(regEx).setType(type);
-        if (validations != null) {
-            try {
-                // TODO defined validator API
-//                builder.addValidations(validations);
-            } catch (Exception e) {
-                Logger.getLogger(getClass().getName()).log(Level.WARNING, "Failed to load validations for " + name, e);
-            }
-        }
-        this.validations.add(builder.build());
-    }
-
-    private void initSection(String name, String desc, String reqVal, String validations) {
-        boolean required = "true".equalsIgnoreCase(reqVal);
-        AreaValidation.Builder builder = AreaValidation.builder(name).setRequired(required)
-                .setDescription(desc);
-        if (validations != null) {
-            try {
-                // TODO defined validator API
-//                builder.addValidations(validations);
-            } catch (Exception e) {
-                Logger.getLogger(getClass().getName()).log(Level.WARNING, "Failed to load validations for " + name, e);
-            }
-        }
-        this.validations.add(builder.build());
-    }
-
-
-    @Override
-    public Collection<Validation> getValidations() {
-        return validations;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0a8226a8/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ConfigValidationsReader.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ConfigValidationsReader.java b/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ConfigValidationsReader.java
new file mode 100644
index 0000000..eaf9aec
--- /dev/null
+++ b/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ConfigValidationsReader.java
@@ -0,0 +1,169 @@
+/*
+ * 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.model.spi;
+
+import org.apache.tamaya.model.Validation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Utility class to read metamodel information from properties. Hereby these properties can be part of a
+ * configuration (containing other entriees as well) or be dedicated model definition properties read
+ * from any kind of source.
+ */
+public final class ConfigValidationsReader {
+
+    /** The logger used. */
+    private static final Logger LOGGER =  Logger.getLogger(ConfigValidationsReader.class.getName());
+
+    /** The default model entries selector. */
+    private static final String DEFAULT_META_INFO_SELECTOR = "{model}";
+    /** parameter to change the selector to be used for filtering out the target values to be used. */
+    private static final String META_INFO_SELECTOR_PARAM = "org.apache.tamaya.model.integrated.selector";
+
+    /**
+     * Loads validations as configured in the given properties.
+     * @param props the properties to be read
+     * @param defaultProviderName the default provider name used if no explicit provider name is configured.
+     * @return a collection of config validations.
+     */
+    public static Collection<Validation> loadValidations(Properties props,
+                                                         String defaultProviderName) {
+        Map<String,String> map = new HashMap<>();
+        for(Map.Entry<Object,Object> en: props.entrySet()){
+            map.put(en.getKey().toString(), props.getProperty(en.getKey().toString()));
+        }
+        return loadValidations(map, defaultProviderName);
+    }
+
+    /**
+     * Loads validations as configured in the given properties.
+     * @param props the properties to be read
+     * @param defaultProviderName the default provider name used if no explicit provider name is configured.
+     * @return a collection of config validations.
+     */
+    public static Collection<Validation> loadValidations(Map<String,String> props,
+                                                         String defaultProviderName) {
+        String selector = props.get(META_INFO_SELECTOR_PARAM);
+        if(selector==null){
+            selector = DEFAULT_META_INFO_SELECTOR;
+        }
+        return loadValidations(props, selector, defaultProviderName);
+    }
+
+    /**
+     * Loads validations as configured in the given properties.
+     * @param props the properties to be read
+     * @param selector the selector (default is {model}), that identifies the model entries.
+     * @param defaultProviderName the default provider name used if no explicit provider name is configured.
+     * @return a collection of config validations.
+     */
+    public static Collection<Validation> loadValidations(Map<String,String> props, String selector,
+                                                         String defaultProviderName) {
+        List<Validation> result = new ArrayList<>();
+        String provider = props.get(selector + ".__provider");
+        if (provider == null) {
+            provider = defaultProviderName;
+        }
+        Set<String> itemKeys = new HashSet<>();
+        for (Object key : props.keySet()) {
+            if (key.toString().endsWith(".class")) {
+                itemKeys.add(key.toString().substring(0, key.toString().length() - ".class".length()));
+            }
+        }
+        for (String baseKey : itemKeys) {
+            String clazz = props.get(baseKey + ".class");
+            String type = props.get(baseKey + ".type");
+            if (type == null) {
+                type = String.class.getName();
+            }
+            String description = props.get(baseKey + ".description");
+            String regEx = props.get(baseKey + ".expression");
+            String validations = props.get(baseKey + ".validations");
+            String requiredVal = props.get(baseKey + ".required");
+            if ("Parameter".equalsIgnoreCase(clazz)) {
+                result.add(createParameterValidation(baseKey.substring(selector.length() + 1), description, type,
+                        requiredVal, regEx, validations));
+            } else if ("Section".equalsIgnoreCase(clazz)) {
+                result.add(createSectionValidation(baseKey.substring(selector.length() + 1), description, requiredVal,
+                        validations));
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Creates a parameter validation.
+     * @param paramName the param name, not null.
+     * @param description the optional description
+     * @param type the param type, default is String.
+     * @param reqVal the required value, default is 'false'.
+     * @param regEx an optional regular expression to be checked for this param
+     * @param validations the optional custom validations to be performed.
+     * @return the new validation for this parameter.
+     */
+    private static Validation createParameterValidation(String paramName, String description, String type, String reqVal,
+                                                       String regEx, String validations) {
+        boolean required = "true".equalsIgnoreCase(reqVal);
+        ParameterValidation.Builder builder = ParameterValidation.builder(paramName).setRequired(required)
+                .setDescription(description).setExpression(regEx).setType(type);
+        if (validations != null) {
+            try {
+                // TODO defined validator API
+//                builder.addValidations(validations);
+            } catch (Exception e) {
+                LOGGER.log(Level.WARNING, "Failed to load validations for " + paramName, e);
+            }
+        }
+       return builder.build();
+    }
+
+    /**
+     * Creates a section validation.
+     * @param sectionName the section's name, not null.
+     * @param description the optional description
+     * @param reqVal the required value, default is 'false'.
+     * @param validations the optional custom validations to be performed.
+     * @return the new validation for this section.
+     */
+    private static Validation createSectionValidation(String sectionName, String description, String reqVal,
+                                                     String validations) {
+        boolean required = "true".equalsIgnoreCase(reqVal);
+        AreaValidation.Builder builder = AreaValidation.builder(sectionName).setRequired(required)
+                .setDescription(description);
+        if (validations != null) {
+            try {
+                // TODO defined validator API
+//                builder.addValidations(validations);
+            } catch (Exception e) {
+                LOGGER.log(Level.WARNING, "Failed to load validations for " + sectionName, e);
+            }
+        }
+        return builder.build();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0a8226a8/sandbox/model/src/main/resources/META-INF/services/org.apache.tamaya.model.spi.ValidationProviderSpi
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/resources/META-INF/services/org.apache.tamaya.model.spi.ValidationProviderSpi b/sandbox/model/src/main/resources/META-INF/services/org.apache.tamaya.model.spi.ValidationProviderSpi
index e2ba992..47c18de 100644
--- a/sandbox/model/src/main/resources/META-INF/services/org.apache.tamaya.model.spi.ValidationProviderSpi
+++ b/sandbox/model/src/main/resources/META-INF/services/org.apache.tamaya.model.spi.ValidationProviderSpi
@@ -16,4 +16,6 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-org.apache.tamaya.model.internal.ConfiguredValidationProviderSpi
+org.apache.tamaya.model.internal.ConfiguredPropertiesValidationProviderSpi
+org.apache.tamaya.model.internal.ConfiguredInlineModelProviderSpi
+org.apache.tamaya.model.internal.ConfiguredResourcesModelProviderSpi

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0a8226a8/sandbox/model/src/test/resources/META-INF/configmodel.properties
----------------------------------------------------------------------
diff --git a/sandbox/model/src/test/resources/META-INF/configmodel.properties b/sandbox/model/src/test/resources/META-INF/configmodel.properties
new file mode 100644
index 0000000..af37705
--- /dev/null
+++ b/sandbox/model/src/test/resources/META-INF/configmodel.properties
@@ -0,0 +1,96 @@
+#
+# 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 current 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.
+#
+
+###################################################################################
+# Example of a configuration metamodel expressed via properties.
+####################################################################################
+
+# Metamodel information
+{model}.provider=ConfigModel Extension
+
+# reusable parameter definition, referenceable as MyNumber
+{model}.MyNumber.class=Parameter
+{model}.MyNumber.type=Integer
+{model}.MyNumber.description=a (reusable) number type parameter (optional)
+
+####################################################################################
+# Description of Configuration Sections (minimal, can be extended by other modules).
+# By default its interpreted as a section !
+####################################################################################
+
+# a (section)
+{model}.a.class=Section
+{model}.a.params2.class=Parameter
+{model}.a.params2.type=String
+{model}.a.params2.required=true
+{model}.a.params2.description=a required parameter
+
+{model}.a.paramInt.class=Parameter
+{model}.a.paramInt.type=ref:MyNumber
+{model}.a.paramInt.description=an optional parameter (default)
+
+{model}.a._number.class=Parameter
+{model}.a._number.type=Integer
+{model}.a._number.deprecated=true
+{model}.a._number.mappedTo=a.paramInt
+
+# a.b.c (section)
+{model}.a.b.c.class=Section
+{model}.a.b.c.description=Just a test section
+
+# a.b.c.aRequiredSection (section)
+{model}.a.b.c.aRequiredSection.class=Section
+{model}.a.b.c.aRequiredSection.required=true
+{model}.a.b.c.aRequiredSection.description=A section containing required parameters is called a required section.\
+         Sections can also explicitly be defined to be required, but without\
+         specifying the paramteres to be contained.,
+
+# a.b.c.aRequiredSection.subsection (section)
+{model}.a.b.c.aRequiredSection.subsection.class=Section
+
+{model}.a.b.c.aRequiredSection.subsection.param0.class=Parameter
+{model}.a.b.c.aRequiredSection.subsection.param0.type=String
+{model}.a.b.c.aRequiredSection.subsection.param0.description=a minmally documented String parameter
+# A minmal String parameter
+{model}.a.b.c.aRequiredSection.subsection.param00.class=Parameter
+{model}.a.b.c.aRequiredSection.subsection.param00.type=String
+
+# a.b.c.aRequiredSection.subsection (section)
+{model}.a.b.c.aRequiredSection.subsection.param1.class=Parameter
+{model}.a.b.c.aRequiredSection.subsection.param1.type = String
+{model}.a.b.c.aRequiredSection.subsection.param1.required = true
+{model}.a.b.c.aRequiredSection.subsection.intParam.class=Parameter
+{model}.a.b.c.aRequiredSection.subsection.intParam.type = Integer
+{model}.a.b.c.aRequiredSection.subsection.intParam.description=an optional parameter (default)
+
+# a.b.c.aRequiredSection.nonempty-subsection (section)
+{model}.a.b.c.aRequiredSection.nonempty-subsection.class=Section
+{model}.a.b.c.aRequiredSection.nonempty-subsection.required=true
+
+# a.b.c.aRequiredSection.optional-subsection (section)
+{model}.a.b.c.aRequiredSection.optional-subsection.class=Section
+
+# a.b.c.aValidatedSection (section)
+{model}.a.b.c.aValidatedSection.class=Section
+{model}.a.b.c.aValidatedSection.description=A validated section.
+{model}.a.b.c.aValidatedSection.validations=org.apache.tamaya.model.TestValidator
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0a8226a8/sandbox/model/src/test/resources/META-INF/configmodel/configmodel.properties
----------------------------------------------------------------------
diff --git a/sandbox/model/src/test/resources/META-INF/configmodel/configmodel.properties b/sandbox/model/src/test/resources/META-INF/configmodel/configmodel.properties
deleted file mode 100644
index 472abc3..0000000
--- a/sandbox/model/src/test/resources/META-INF/configmodel/configmodel.properties
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# 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 current 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.
-#
-
-###################################################################################
-# Example of a configuration metamodel expressed via properties.
-####################################################################################
-
-# Metamodel information
-[model].provider=ConfigModel Extension
-
-# reusable parameter definition, referenceable as MyNumber
-[MyNumber].class=Parameter
-[MyNumber].type=Integer
-[MyNumber].description=a (reusable) number type parameter (optional)
-
-####################################################################################
-# Description of Configuration Sections (minimal, can be extended by other modules).
-# By default its interpreted as a section !
-####################################################################################
-
-# a (section)
-a.class=Section
-a.params2.class=Parameter
-a.params2.type=String
-a.params2.required=true
-a.params2.description=a required parameter
-
-a.paramInt.class=Parameter
-a.paramInt.ref=MyNumber
-a.paramInt.description=an optional parameter (default)
-
-a._number.class=Parameter
-a._number.type=Integer
-a._number.deprecated=true
-a._number.mappedTo=a.paramInt
-
-# a.b.c (section)
-a.b.c.class=Section
-a.b.c.description=Just a test section
-
-# a.b.c.aRequiredSection (section)
-a.b.c.aRequiredSection.class=Section
-a.b.c.aRequiredSection.required=true
-a.b.c.aRequiredSection.description=A section containing required parameters is called a required section.\
-         Sections can also explicitly be defined to be required, but without\
-         specifying the paramteres to be contained.,
-
-# a.b.c.aRequiredSection.subsection (section)
-a.b.c.aRequiredSection.subsection.class=Section
-
-a.b.c.aRequiredSection.subsection.param0.class=Parameter
-a.b.c.aRequiredSection.subsection.param0.type=String
-a.b.c.aRequiredSection.subsection.param0.description=a minmally documented String parameter
-# A minmal String parameter
-a.b.c.aRequiredSection.subsection.param00.class=Parameter
-a.b.c.aRequiredSection.subsection.param00.type=String
-
-# a.b.c.aRequiredSection.subsection (section)
-a.b.c.aRequiredSection.subsection.param1.class=Parameter
-a.b.c.aRequiredSection.subsection.param1.type = String
-a.b.c.aRequiredSection.subsection.param1.required = true
-a.b.c.aRequiredSection.subsection.intParam.class=Parameter
-a.b.c.aRequiredSection.subsection.intParam.type = Integer
-a.b.c.aRequiredSection.subsection.intParam.description=an optional parameter (default)
-
-# a.b.c.aRequiredSection.nonempty-subsection (section)
-a.b.c.aRequiredSection.nonempty-subsection.class=Section
-a.b.c.aRequiredSection.nonempty-subsection.required=true
-
-# a.b.c.aRequiredSection.optional-subsection (section)
-a.b.c.aRequiredSection.optional-subsection.class=Section
-
-# a.b.c.aValidatedSection (section)
-a.b.c.aValidatedSection.class=Section
-a.b.c.aValidatedSection.description=A validated section.
-a.b.c.aValidatedSection.validations=org.apache.tamaya.model.TestValidator
-
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0a8226a8/sandbox/model/src/test/resources/examples/configmodel.ini
----------------------------------------------------------------------
diff --git a/sandbox/model/src/test/resources/examples/configmodel.ini b/sandbox/model/src/test/resources/examples/configmodel.ini
index e5f3c70..ec4070c 100644
--- a/sandbox/model/src/test/resources/examples/configmodel.ini
+++ b/sandbox/model/src/test/resources/examples/configmodel.ini
@@ -22,33 +22,10 @@
 ####################################################################################
 
 ####################################################################################
-# Metamodel information
-####################################################################################
-[model]
-class = Meta-model
-name = testmodel,
-provider = ConfigModel Extension,
-version = 1.0,
-release-date = 2001-01-23,
-author = Anatole Tresch,
-# model-format    = alternate format reader type
-comments : = Late afternoon is best.\
-           Backup contact is Nancy.
-
-####################################################################################
-# Reusable parameter definitions.
-####################################################################################
-// reusable parameter definition
-[MyNumber]
-class = "Parameter"
-type = Integer",
-description = a (reusable) number type parameter (optional)
-
-####################################################################################
 # Description of Configuration Sections (minimal, can be extended by other modules).
 # By default its interpreted as a section !
 ####################################################################################
-[a]
+[{model}a]
 class = Section
 params2.type = String
 params2.required = true
@@ -59,18 +36,18 @@ _number.type = Integer
 _number.deprecated = true
 _number.mappedTo = "a.paramInt"
 
-[a.b.c]
+[{model}a.b.c]
 class = Section
 description = Just a test section
 
-[a.b.c.aRequiredSection]
+[{model}a.b.c.aRequiredSection]
 class = Section
 required = true
 description = A section containing required parameters is called a required section.\
          Sections can also explicitly be defined to be required, but without\
          specifying the paramteres to be contained.,
 
-[a.b.c.aRequiredSection.subsection]
+[{model}a.b.c.aRequiredSection.subsection]
 class = Section
 param0.type = String
 param0.description = "a minmally documented String parameter"
@@ -82,14 +59,14 @@ param1.required = true
 intParam.type = Integer
 intParam.description = "an optional parameter (default)"
 
-[a.b.c.aRequiredSection.nonempty-subsection]
+[{model}a.b.c.aRequiredSection.nonempty-subsection]
 class = Section
 required = true
 
-[a.b.c.aRequiredSection.optional-subsection]
+[{model}a.b.c.aRequiredSection.optional-subsection]
 class = Section
 
-[a.b.c.aValidatedSection]
+[{model}a.b.c.aValidatedSection]
 class = Section
 description = "A validation section."
 validations = org.apache.tamaya.model.TestValidator?max=3

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0a8226a8/sandbox/model/src/test/resources/examples/configmodel.json
----------------------------------------------------------------------
diff --git a/sandbox/model/src/test/resources/examples/configmodel.json b/sandbox/model/src/test/resources/examples/configmodel.json
index 6c111ae..1fd831e 100644
--- a/sandbox/model/src/test/resources/examples/configmodel.json
+++ b/sandbox/model/src/test/resources/examples/configmodel.json
@@ -28,87 +28,86 @@
 // Metamodel information
 //##################################################################################
 {
-  "model": {
-    "class": "Metamodel",
-    "name": "testmodel",
-    "provider": "ConfigModel Extension",
-    "version": "1.0",
-    "release-date": "2001-01-23",
-    "author": "Anatole Tresch",
+  "{model}": {
+    "__name": "testmodel",
+    "__provider": "ConfigModel Extension",
+    "__version": "1.0",
+    "__release-date": "2001-01-23",
+    "__author": "Anatole Tresch",
     // "modelformat": "alternate format reader type"
-    "comments": "Late afternoon is best. Backup contact is Nancy."
-  },
-  // reusable parameter definition
-  "MyNumber": {
-    "class": "Parameter",
-    "type": "Integer",
-    "description": "an (reusable) number type parameter (optional)"
-  },
-  //##################################################################################
-  // Description of Configuration Sections (minimal, can be extended by other modules).
-  //##################################################################################
-  "a": {
-    "class": "Section",
-    // required, default is parameter!
-    "params2": {
-      "required": true,
-      "description": "a required parameter"
+    "__comments": "Late afternoon is best. Backup contact is Nancy.",
+    // reusable parameter definition
+    "MyNumber": {
+      "class": "Parameter",
+      "type": "Integer",
+      "template": true,
+      "description": "an (reusable) number type parameter (optional)"
     },
-    "paramInt": {
-      // references a shared parameter definition.
-      "ref": "MyNumber",
-      "description": "an optional parameter (default)"
+    //##################################################################################
+    // Description of Configuration Sections (minimal, can be extended by other modules).
+    //##################################################################################
+    "a": {
+      "class": "Section",
+      // required, default is parameter!
+      "params2": {
+        "required": true,
+        "description": "a required parameter"
+      },
+      "paramInt": {
+        // references a shared parameter definition.
+        "ref": "MyNumber",
+        "description": "an optional parameter (default)"
+      },
+      "_number": {
+        "type": "Integer",
+        "deprecated": true,
+        // references a deprecated parameter, now mapped to 'a.paramInt'.
+        "mappedto": "a.paramInt"
+      }
     },
-    "_number": {
-      "type": "Integer",
-      "deprecated": true,
-      // references a deprecated parameter, now mapped to 'a.paramInt'.
-      "mappedto": "a.paramInt"
-    }
-  },
-  "a.b.c": {
-    "class": "Section",
-    "description": "Just a test section."
-    // a subsection, directly configured as child element.
-    "aRequiredSection": {
+    "a.b.c": {
       "class": "Section",
-      "required": true,
-      "description": "A section containing required parameters is called a required section."
-    }
-  },
-  // a subsection, configured in its own section.
-  "a.b.c.aRequiredSection.subsection": {
-    "class": "Section",
-    "param0": {
-      "type": "String",
-      "description": "a minmally documented String parameter"
+      "description": "Just a test section."
+      // a subsection, directly configured as child element.
+      "aRequiredSection": {
+        "class": "Section",
+        "required": true,
+        "description": "A section containing required parameters is called a required section."
+      }
+    },
+    // a subsection, configured in its own section.
+    "a.b.c.aRequiredSection.subsection": {
+      "class": "Section",
+      "param0": {
+        "type": "String",
+        "description": "a minmally documented String parameter"
+      },
+      // A minmally defined String parameter
+      "param00": {},
+      "param1": {
+        "type": "String",
+        "required": true,
+        "description": "a required parameter"
+      },
+      "intParam": {
+        "type": "Integer",
+        "required": true,
+        "description": "an optional parameter (default)"
+      }
     },
-    // A minmally defined String parameter
-    "param00": {},
-    "param1": {
-      "type": "String",
-      "required": true,
-      "description": "a required parameter"
+    "a.b.c.aRequiredSection.nonempty-subsection": {
+      "class": "Section",
+      "required": true
     },
-    "intParam": {
-      "type": "Integer",
-      "required": true,
-      "description": "an optional parameter (default)"
-    }
-  },
-  "a.b.c.aRequiredSection.nonempty-subsection": {
-    "class": "Section",
-    "required": true
-  },
-  "a.b.c.aRequiredSection.optional-subsection": {
-    "class": "Section"
-  },
-  "a.b.c.aRequiredSection.aValidatedSection": {
-    "class": "Section",
-    "description": "A validated section.",
-    "validations":
-      "org.apache.tamaya.model.validation.MaxItemValidator?max=3"
+    "a.b.c.aRequiredSection.optional-subsection": {
+      "class": "Section"
+    },
+    "a.b.c.aRequiredSection.aValidatedSection": {
+      "class": "Section",
+      "description": "A validated section.",
+      "validations": "org.apache.tamaya.model.validation.MaxItemValidator?max=3"
     }
+  }
 }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0a8226a8/sandbox/model/src/test/resources/examples/configmodel.properties
----------------------------------------------------------------------
diff --git a/sandbox/model/src/test/resources/examples/configmodel.properties b/sandbox/model/src/test/resources/examples/configmodel.properties
index 7609511..4e69549 100644
--- a/sandbox/model/src/test/resources/examples/configmodel.properties
+++ b/sandbox/model/src/test/resources/examples/configmodel.properties
@@ -22,19 +22,12 @@
 ####################################################################################
 
 # Metamodel information
-[model].class=Meta-model
-[model].name=testmodel
-[model].provider=ConfigModel Extension
-[model].version=1.0
-[model].release-date=2001-01-23
-[model].author=Anatole Tresch
-# [model].format=alternate format reader type
-[model].comments=Late afternoon is best. Backup contact is Nancy.
+{model}.__provider=ConfigModel Extension
 
 # reusable parameter definition, referenceable as MyNumber
-[MyNumber].class=Parameter
-[MyNumber].type=Integer
-[MyNumber].description=a (reusable) number type parameter (optional)
+{model}.MyNumber.class=Parameter
+{model}.MyNumber.type=Integer
+{model}.MyNumber.description=a (reusable) number type parameter (optional)
 
 ####################################################################################
 # Description of Configuration Sections (minimal, can be extended by other modules).
@@ -42,51 +35,61 @@
 ####################################################################################
 
 # a (section)
-a.class=Section
-a.params2.type=String
-a.params2.required=true
-a.params2.description=a required parameter
-a.paramInt.ref=MyNumber
-a.paramInt.description=an optional parameter (default)
-a._number.type=Integer
-a._number.deprecated=true
-a._number.mappedTo=a.paramInt
+{model}.a.class=Section
+{model}.a.params2.class=Parameter
+{model}.a.params2.type=String
+{model}.a.params2.required=true
+{model}.a.params2.description=a required parameter
+
+{model}.a.paramInt.class=Parameter
+{model}.a.paramInt.type=ref:MyNumber
+{model}.a.paramInt.description=an optional parameter (default)
+
+{model}.a._number.class=Parameter
+{model}.a._number.type=Integer
+{model}.a._number.deprecated=true
+{model}.a._number.mappedTo=a.paramInt
 
 # a.b.c (section)
-a.b.c.class=Section
-a.b.c.description=Just a test section
+{model}.a.b.c.class=Section
+{model}.a.b.c.description=Just a test section
 
 # a.b.c.aRequiredSection (section)
-a.b.c.aRequiredSection.class=Section
-a.b.c.aRequiredSection.required=true
-a.b.c.aRequiredSection.description=A section containing required parameters is called a required section.\
+{model}.a.b.c.aRequiredSection.class=Section
+{model}.a.b.c.aRequiredSection.required=true
+{model}.a.b.c.aRequiredSection.description=A section containing required parameters is called a required section.\
          Sections can also explicitly be defined to be required, but without\
          specifying the paramteres to be contained.,
 
 # a.b.c.aRequiredSection.subsection (section)
-a.b.c.aRequiredSection.subsection.class=Section
-a.b.c.aRequiredSection.subsection.param0.type=String
-a.b.c.aRequiredSection.subsection.param0.description=a minmally documented String parameter
+{model}.a.b.c.aRequiredSection.subsection.class=Section
+
+{model}.a.b.c.aRequiredSection.subsection.param0.class=Parameter
+{model}.a.b.c.aRequiredSection.subsection.param0.type=String
+{model}.a.b.c.aRequiredSection.subsection.param0.description=a minmally documented String parameter
 # A minmal String parameter
-a.b.c.aRequiredSection.subsection.param00.type = String
+{model}.a.b.c.aRequiredSection.subsection.param00.class=Parameter
+{model}.a.b.c.aRequiredSection.subsection.param00.type=String
 
 # a.b.c.aRequiredSection.subsection (section)
-a.b.c.aRequiredSection.subsection.param1.type = String
-a.b.c.aRequiredSection.subsection.param1.required = true
-a.b.c.aRequiredSection.subsection.intParam.type = Integer
-a.b.c.aRequiredSection.subsection.intParam.description=an optional parameter (default)
+{model}.a.b.c.aRequiredSection.subsection.param1.class=Parameter
+{model}.a.b.c.aRequiredSection.subsection.param1.type = String
+{model}.a.b.c.aRequiredSection.subsection.param1.required = true
+{model}.a.b.c.aRequiredSection.subsection.intParam.class=Parameter
+{model}.a.b.c.aRequiredSection.subsection.intParam.type = Integer
+{model}.a.b.c.aRequiredSection.subsection.intParam.description=an optional parameter (default)
 
 # a.b.c.aRequiredSection.nonempty-subsection (section)
-a.b.c.aRequiredSection.nonempty-subsection.class=Section
-a.b.c.aRequiredSection.nonempty-subsection.required=true
+{model}.a.b.c.aRequiredSection.nonempty-subsection.class=Section
+{model}.a.b.c.aRequiredSection.nonempty-subsection.required=true
 
 # a.b.c.aRequiredSection.optional-subsection (section)
-a.b.c.aRequiredSection.optional-subsection.class=Section
+{model}.a.b.c.aRequiredSection.optional-subsection.class=Section
 
 # a.b.c.aValidatedSection (section)
-a.b.c.aValidatedSection.class=Section
-a.b.c.aValidatedSection.description=A validated section.
-a.b.c.aValidatedSection.validations=org.apache.tamaya.model.TestValidator?max=3
+{model}.a.b.c.aValidatedSection.class=Section
+{model}.a.b.c.aValidatedSection.description=A validated section.
+{model}.a.b.c.aValidatedSection.validations=org.apache.tamaya.model.TestValidator
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0a8226a8/sandbox/model/src/test/resources/examples/configmodel.xml
----------------------------------------------------------------------
diff --git a/sandbox/model/src/test/resources/examples/configmodel.xml b/sandbox/model/src/test/resources/examples/configmodel.xml
index bf35f79..dd78c05 100644
--- a/sandbox/model/src/test/resources/examples/configmodel.xml
+++ b/sandbox/model/src/test/resources/examples/configmodel.xml
@@ -28,72 +28,70 @@ under the License.
 # Metamodel information
 #################################################################################-->
 
-<model class="Metamodel">
-    <name>testmodel</name>
-    <provider>ConfigModel Extension</provider>
-    <version>1.0</version>
-    <release-date>2001-01-23</release-date>
-    <author>Anatole Tresch</author>
-    <!-- model-format>alternate format reader type</model-format -->
-    <comments>Late afternoon is best.
-        Backup contact is Nancy.
-    </comments>
+<configuration>
+    <section name="{model}" __provider="ConfigModel Extension" version="1.0" __release-date="2001-01-23"
+            author="Anatole Tresch">
+        <!-- model-format>alternate format reader type</model-format -->
+        <__description>Late afternoon is best.
+            Backup contact is Nancy.
+        </__description>
 
-    <!--################################################################################
-    # Description of Configuration Sections (minimal, can be extended by other modules).
-    #################################################################################-->
-    <a class="Section">
-        <params class="Parameter">
-            <type>String</type>
-            <required>true</required>
-            <description>a required parameter</description>
-        </params>
-        <paramInt>
-            <ref>MyNumber</ref>
-            <required>true</required>
-            <description>an optional parameter (default)</description>
-        </paramInt>
-        <_number>
-            <type>Integer</type>
-            <deprecated>true</deprecated>
-            <mappedto>a.paramInt</mappedto>
-        </_number>
-        <b.c class="Section">
-            <description>Just a test section.</description>
-            <aRequiredSection class="Section">
-                <description>A section containing required parameters is called a required section.
-                    Sections can also explicitly be defined to be required, but without
-                    specifying the paramteres to be contained.
-                </description>
-            </aRequiredSection>
-        </b.c>
-    </a>
+        <!--################################################################################
+        # Description of Configuration Sections (minimal, can be extended by other modules).
+        #################################################################################-->
+        <section name="a">
+            <param name="params">
+                <type>String</type>
+                <required>true</required>
+                <description>a required parameter</description>
+            </param>
+            <param name="paramInt">
+                <ref>MyNumber</ref>
+                <required>true</required>
+                <description>an optional parameter (default)</description>
+            </param>
+            <param name="_number">
+                <type>Integer</type>
+                <deprecated>true</deprecated>
+                <mappedto>a.paramInt</mappedto>
+            </param>
+            <section name="b.c">
+                <description>Just a test section.</description>
+                <section name="aRequiredSection">
+                    <description>A section containing required parameters is called a required section.
+                        Sections can also explicitly be defined to be required, but without
+                        specifying the paramteres to be contained.
+                    </description>
+                </section>
+            </section>
+        </section>
 
-    <a.b.c.aRequiredSection.subsection class="Section">
-        <param name="param0" type="String">a minmally documented String parameter</param>
-        <!-- # A minmally defined String parameter -->
-        <param00>
-            <type>String</type>
-        </param00>
-        <param1>
-            <type>String</type>
+        <section name="a.b.c.aRequiredSection.subsection">
+            <param name="param0" type="String">a minmally documented String parameter</param>
+            <!-- # A minmally defined String parameter -->
+            <param name="param00">
+                <type>String</type>
+            </param>
+            <param name="param1">
+                <type>String</type>
+                <required>true</required>
+                <description>a required parameter</description>description>
+            </param>
+            <param name="intParam">
+                <type>Integer</type>
+                <description>an optional parameter (default)</description>
+            </param>
+            <section name="b.c">
+                <description>Just a test section.</description>
+            </section>
+        </section>
+        <section name="a.b.c.aRequiredSection.nonempty-subsection">
             <required>true</required>
-            <description>a required parameter</description>description>
-        </param1>
-        <intParam>
-            <type>Integer</type>
-            <description>an optional parameter (default)</description>
-        </intParam>
-        <b.c class="Section">
-            <description>Just a test section.</description>
-        </b.c>
-    </a.b.c.aRequiredSection.subsection>
-    <a.b.c.aRequiredSection.nonempty-subsection>
-        <required>true</required>
-    </a.b.c.aRequiredSection.nonempty-subsection>
-    <a.b.c.aRequiredSection.optional-subsection class="Section"/>
-    <a.b.c.aRequiredSection.aValidatedSection>
-        <validations>org.apache.tamaya.model.validation.MaxItemValidator?max=3"</validations>
-        <description>A validation section.</description>
-    </a.b.c.aRequiredSection.aValidatedSection>
-</model>
+        </section>
+        <section name="a.b.c.aRequiredSection.optional-subsection"/>
+        <section name="a.b.c.aRequiredSection.aValidatedSection">
+            <validations>org.apache.tamaya.model.validation.MaxItemValidator?max=3"</validations>
+            <description>A validation section.</description>
+        </section>
+    </section>
+</configuration>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0a8226a8/sandbox/model/src/test/resources/examples/configmodel.yaml
----------------------------------------------------------------------
diff --git a/sandbox/model/src/test/resources/examples/configmodel.yaml b/sandbox/model/src/test/resources/examples/configmodel.yaml
index 4c9cf12..a59246a 100644
--- a/sandbox/model/src/test/resources/examples/configmodel.yaml
+++ b/sandbox/model/src/test/resources/examples/configmodel.yaml
@@ -17,27 +17,24 @@
 # under the License.
 #
 
-
 ##################################################################################
 # Example of a configuration metamodel expressed via YAML(tm).
 #   Structure is shown through indentation (one or more spaces).
 #   Sequence items are denoted by a dash,
 #   key value pairs within a map are separated by a colon.
 ####################################################################################
-tbd (adapt to others...)
 
 ####################################################################################
 # Metamodel information
 ####################################################################################
-model: {
-  class          :  "Metamodel",
-  name           :  'testmodel',
-  provider       :  'ValidationProviderSpi Extension',
-  version        :  '1.0',
-  release-date   :  2001-01-23,
-  author         :  'Anatole Tresch',
+{model}: {
+  __name           :  'testmodel',
+  __provider       :  'ValidationProviderSpi Extension',
+  __version        :  '1.0',
+  __release-date   :  2001-01-23,
+  __author         :  'Anatole Tresch',
   # model-format: 'alternate format reader type'
-  comments: >
+  __description: >
     Late afternoon is best.
     Backup contact is Nancy.
 }
@@ -46,47 +43,64 @@ model: {
 # Description of Configuration Sections (minimal, can be extended by other modules).
 ####################################################################################
 ---
-a: {
-# Paramname Type         Validations    Description
-  params2:  'String',    'required',   'a required parameter',
+{model}.a.params2: {
+  type          : 'String',
+  required      : true,
+  description   : 'a required parameter',
   paramInt: 'Integer',                 'an optional parameter (default)',
 }
 ---
-a.b.c: {
-  __desc:  'Just a test section.'
+{model}.a.paramInt: {
+  type          : 'Integer',
+  description   : 'an optional parameter (default)',
+}
+---
+{model}.a.b.c: {
+  description:  'Just a test section.'
 }
 ---
-a.b.c.aRequiredSection: {
-  __validations: 'required',
-  __desc: |
+{model}.a.b.c.aRequiredSection: {
+  required: true,
+  description: |
              A section containing required parameters is called a required section.
              Sections can also explicitly be defined to be required, but without
              specifying the paramteres to be contained.,
 }
 ---
-a.b.c.aRequiredSection.subsection: {
-# Paramname   Type         Validations   Description
-  param0:    'String',                   'a minmally documented String parameter}',
-  param00:   'String',                                 # A minmally defined String parameter
-  param1:    'String',     'required',   'a required parameter',
-  intParam:  'Integer',                  'an optional parameter (default)'
+{model}.a.b.c.aRequiredSection.subsection: {
+  param0: {
+    type: 'String',
+    description: 'a minmally documented String parameter}'
+  },                 ,
+  param00:{
+    type: 'String'        # A minmally defined String parameter
+  },
+  param1: {
+    tpye: 'String',
+    required: true,
+    description: 'a required parameter'
+  },
+  intParam: {
+    type: 'Integer',
+    description: 'an optional parameter (default)'
+  }
 }
 ...
 
 ---
-a.b.c.aRequiredSection.nonempty-subsection: {
-  __validations: 'required'
+{model}.a.b.c.aRequiredSection.nonempty-subsection: {
+  required: true
 }
 ...
 
 ---
-a.b.c.aRequiredSection.optional-subsection: {}
+{model}.a.b.c.aRequiredSection.optional-subsection: {}
 ...
 
 ---
-a.b.c.aRequiredSection.aValidatedSection: {
-  __desc: 'A validation section.',
-  __validations: 'org.apache.tamaya.model.validation.MaxItemValidator?max=3'
+{model}.a.b.c.aRequiredSection.aValidatedSection: {
+  description: 'A validation section.',
+  validations: 'org.apache.tamaya.model.validation.MaxItemValidator?max=3'
 }
 
 


[3/3] incubator-tamaya git commit: Added documentation for model extension.

Posted by an...@apache.org.
Added documentation for model extension.


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

Branch: refs/heads/master
Commit: 069ec3667a22ee1ecf83382da5f19f5047c25f2a
Parents: 56d86ee
Author: anatole <an...@apache.org>
Authored: Mon Aug 17 10:09:30 2015 +0200
Committer: anatole <an...@apache.org>
Committed: Mon Aug 17 10:09:59 2015 +0200

----------------------------------------------------------------------
 docs/src/main/asciidoc/mod_model.adoc | 190 +++++++++++++++++++++++++++--
 1 file changed, 180 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/069ec366/docs/src/main/asciidoc/mod_model.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/mod_model.adoc b/docs/src/main/asciidoc/mod_model.adoc
index fdfe776..96cc682 100644
--- a/docs/src/main/asciidoc/mod_model.adoc
+++ b/docs/src/main/asciidoc/mod_model.adoc
@@ -71,7 +71,7 @@ To benefit from configuration builder support you only must add the correspondin
 -----------------------------------------------
 
 
-=== Describing Meta-Configuration
+=== Describing the Configuration Meta-Model
 
 Basically configuration is modelled using key, valuje-pairs of Strings. Looking at a keys
 +a.b.c.param1+ and +a.b.c.param2+ the following concepts can be used to defined/describe
@@ -83,13 +83,14 @@ configuration:
  which equals to the containing section name and the relative parameter name, separated by the dor separator.
  In the above example +a.b.c.param1+ and +a.b.c.param2+ are the fully qualified parameter names.
 
-Now with only these 2 concepts a simple meta-model can be defined as
+Now with only these 2 concepts a simple configuration meta-model can be defined as
 
 * a meta-model's name, used just for grouping different meta-models and entries to better separate
   descriptions, e.g. in a management console or generated configuration documentation site.
 * a set of sections.
 * a set of parameters.
 * Both, sections as well as parameters,
+  ** are prefixed with the meta-model selector, by default +{model}.+.
   ** are identified by their _fully qualified names_, where '.' is used as
      a separator character.
   ** may be required, or optional
@@ -115,18 +116,187 @@ sections, despite the fact that section properties, such as description and cust
 its parent, or child section.
 
 
-=== Providing Meta-Configuration using .properties files
+=== Defining Meta-Configuration Model
 
-tbd
+The configuration meta-model is defined by simple configuration entries. The root section for all model configuration
+by default is called +{model}+. Within this section fully qualified configuration keys defines which part of the
+configuration is targeted by certain entries.
 
-=== Providing Meta-Configuration using .json files
+==== Defining Sections
 
-tbd
+First we start to define some configuration sections, the example below starts with the most important
+variants supported:
 
-=== Providing Meta-Configuration using .yaml files
+[source,listing]
+-------------------------------------------------------------------------------
+# Metamodel information
+{model}.provider=ConfigModel Extension
 
-tbd
+# org.mycompany.root (optional section)
+{model}.org.mycompany.root.class=Section
+{model}.org.mycompany.root.description=Root section defining my company configuration.
 
-=== Providing Meta-Configuration using .xml files
+# org.mycompany.security (required section)
+{model}.org.mycompany.security.class=Section
+{model}.org.mycompany.security.required=true
+{model}.org.mycompany.security.description=Security related settings.\
+         refer for further details to XXX.
 
-tbd
\ No newline at end of file
+# minmal section
+{model}.minimal.class=Section
+
+# custom validated section
+{model}.validated.class=Section
+{model}.validated.validations=org.apache.tamaya.model.TestValidator
+-------------------------------------------------------------------------------
+
+Above +org.mycompany.root+ transitively defines 3 sections:
+
+* org
+* org.mycompany
+* org.mycompany.root
+
+All sections are optional. Additionally the model above also defines a required section +org.mycompany.security+.
+Required sections are checked so the section is not empty. It is not checked for any specific parameter hereby,
+only the existance of any child parameter is validated.
+
+The _class_ attribute has to be defined for any section definition, because if not set a model entry is, by default,
+defined to be a parameter validation entry. Given above the entry for the section +minimal+ shows such a minimal
+entry.
+
++validated+ defines a section, which is validated through a customizable validator. Hereby an ordered list of validators
+can be provided, separated by commas.
+
+
+==== Defining Parameters
+
+Similarly parameters also can be defined:
+
+[source,listing]
+-------------------------------------------------------------------------------
+# org.mycompany.root.name (required parameter)
+{model}.org.mycompany.root.name.class=Parameter
+{model}.org.mycompany.root.name.required=true
+{model}.org.mycompany.root.name.description=The company's name, also used in the application's main header.
+
+# org.mycompany.security (required parameters)
+{model}.org.mycompany.security.uid.required=true
+{model}.org.mycompany.security.uid.description=The user id.
+{model}.org.mycompany.security.realm.required=true
+{model}.org.mycompany.security.realm.validations=org.apache.tamaya.model.RealmValidator
+{model}.org.mycompany.security.real.description=The security realm required.
+{model}.org.mycompany.security.tokenid.description=The token id, if the token service is used (optional).
+
+# A minmal parameter
+{model}.minimalClass.class.type=Class
+-------------------------------------------------------------------------------
+
+Similarly as when defining section also parameter entries define transitively its containing sections. E.g.
+the entry above for +org.mycompany.security.realm+ also defines the following sections (as optional).
+
+* org
+* org.mycompany
+* org.mycompany.security
+
+Additional entries for section, e.g. validations to be done, can be added as described in the previous section,
+but are optional.
+
+Since the parameter is the default type for model entries, a minmal parameter model entry only only needs it's
+parameter type to be defined. In the example above we define a parameter +minimalClass+ of type +Class+.
+Types hereby are fully qualified class names, whereas as 'java.lang' for built-in language types can be
+ommitted.
+
+==== Model Locations
+
+By default the configuration model can be defined at the following locations:
+
+* +classpath*:META-INF/configmodel.properties+, separate to the current +Configuration+. This functionality is enabled
+  by default, but can be disabled by adding +org.apache.tamaya.model.default.enabled=false+ to your current
+  +Configuration+.
+* +implicitly as part of the current +Configuration+. THis can be disabled by setting
+  the +org.apache.tamaya.model.integrated.enabled+ configuration poarameter to +false+.
+* customized by configuring the +org.apache.tamaya.model.resources+ in the current +Configuration+. This
+  parameter allows to define the locations from where the model extension is trying to read the
+  model configuration. If the _resources extension_ is available in your system it is used to
+  evaluate the locations. If not the default +Classloader.getResources+ command is issued. Also it
+  is required that the _formats extension_ is available, since this is used to effectively read the
+  data. This extension also allows you to use alternate representation formats such as +ini, xml, yml, json+.
+
+
+
+==== Programmatic API
+
+Basically the validation module provides a simple API to evaluate the current +Configuration+ by as follows:
+
+[source,java]
+-----------------------------------------------------------
+public final class ConfigValidator {
+
+    private ConfigValidator() {}
+
+    public static Collection<ValidationResult> validate();
+    public static Collection<ValidationResult> validate(boolean showUndefined);
+    public static Collection<ValidationResult> validate(Configuration config);
+    public static Collection<ValidationResult> validate(Configuration config, boolean showUndefined);
+
+    public static Collection<Validation> getValidations();
+}
+-----------------------------------------------------------
+
+This singleton allows to validate the current or any +Configuration+ instance. All the validations read also are
+available from the +getValidations+ method, which returns you not less than a instance of the current
+configuration model. This instance can be used to provide documentation, e.g. as part of a CLI interface or
+shown on a documentation web server.
+
+A +Validation+ hereby is defined as:
+
+[source,java]
+-----------------------------------------------------------
+public interface Validation {
+
+    String getType();
+    String getName();
+    String getDescription();
+    Collection<ValidationResult> validate(Configuration config);
+}
+-----------------------------------------------------------
+
+Similarly a +ValidationResult+ is modelled as:
+
+[source,java]
+-----------------------------------------------------------
+public final class ValidationResult {
+
+    public static ValidationResult ofValid(Validation validation);
+    public static ValidationResult ofMissing(Validation validation);
+    public static ValidationResult ofMissing(Validation validation, String message);
+    public static ValidationResult ofError(Validation validation, String error);
+    public static ValidationResult ofWarning(Validation validation, String warning);
+    public static ValidationResult ofDeprecated(Validation validation, String alternateUsage);
+    public static ValidationResult ofDeprecated(Validation validation);
+    public static ValidationResult ofUndefined(final String key);
+    public static ValidationResult of(Validation validation, ValidationState result, String message);
+
+    public Validation getValidation();
+    public ValidationState getResult();
+    public String getMessage(),
+}
+-----------------------------------------------------------
+
+
+== Model SPI
+
+The model extension also provides an SPI where customized functionality can be added. The main abstraction hereby is
+the +ValidationProviderSpi+ interface, which allows any kind of additional validations to be added to the system:
+
+[source,java]
+-----------------------------------------------------------
+public interface ValidationProviderSpi {
+
+    Collection<Validation> getValidations();
+
+}
+-----------------------------------------------------------
+
+New instances implementing this interface must be registered into the current +ServiceContext+, by default the
++ServiceLoader+ is used.
\ No newline at end of file