tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ple...@apache.org
Subject [08/24] incubator-tamaya git commit: Removed all modules from the main repository. They will be reborn in separate ASF repository.
Date Thu, 15 Sep 2016 17:26:25 GMT
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/Validation.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/Validation.java b/modules/model/src/main/java/org/apache/tamaya/model/Validation.java
deleted file mode 100644
index 39b72ed..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/Validation.java
+++ /dev/null
@@ -1,203 +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 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;
-
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.model.spi.AbstractConfigModel;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Objects;
-
-/**
- * Models a partial configuration configModel result.
- */
-public final class Validation {
-    /**
-     * the config section.
-     */
-    private final ConfigModel configModel;
-    /**
-     * The configModel result.
-     */
-    private final ValidationResult result;
-    /**
-     * The configModel message.
-     */
-    private final String message;
-
-    /**
-     * Creates a new ValidationResult.
-     *
-     * @param configModel the configModel item, not null.
-     * @return a new validation result containing valid parts of the given model.
-     */
-    public static Validation ofValid(ConfigModel configModel) {
-        return new Validation(configModel, ValidationResult.VALID, null);
-    }
-
-    /**
-     * Creates a new ValidationResult.
-     *
-     * @param configModel the configModel item, not null.
-     * @return a new validation result containing missing parts of the given model.
-     */
-    public static Validation ofMissing(ConfigModel configModel) {
-        return new Validation(configModel, ValidationResult.MISSING, null);
-    }
-
-    /**
-     * Creates a new ValidationResult.
-     *
-     * @param configModel the configModel item, not null.
-     * @param message Additional message to be shown (optional).
-     * @return a new validation result containing missing parts of the given model with a message.
-     */
-    public static Validation ofMissing(ConfigModel configModel, String message) {
-        return new Validation(configModel, ValidationResult.MISSING, message);
-    }
-
-    /**
-     * Creates a new ValidationResult.
-     *
-     * @param configModel the configModel item, not null.
-     * @param error error message to add.
-     * @return a new validation result containing erroneous parts of the given model with the given error message.
-     */
-    public static Validation ofError(ConfigModel configModel, String error) {
-        return new Validation(configModel, ValidationResult.ERROR, error);
-    }
-
-    /**
-     * Creates a new ValidationResult.
-     *
-     * @param configModel the configModel item, not null.
-     * @param warning warning message to add.
-     * @return a new validation result containing warning parts of the given model with the given warning message.
-     */
-    public static Validation ofWarning(ConfigModel configModel, String warning) {
-        return new Validation(configModel, ValidationResult.WARNING, warning);
-    }
-
-    /**
-     * Creates a new ValidationResult.
-     *
-     * @param configModel the configModel item, not null.
-     * @param alternativeUsage allows setting a message to indicate non-deprecated replacement, maybe null.
-     * @return a new validation result containing deprecated parts of the given model with an optional message.
-     */
-    public static Validation ofDeprecated(ConfigModel configModel, String alternativeUsage) {
-        return new Validation(configModel, ValidationResult.DEPRECATED, alternativeUsage != null ? "Use instead: " + alternativeUsage : null);
-    }
-
-    /**
-     * Creates a new ValidationResult.
-     *
-     * @param configModel the configModel item, not null.
-     * @return a new validation result containing deprecated parts of the given model.
-     */
-    public static Validation ofDeprecated(ConfigModel configModel) {
-        return new Validation(configModel, ValidationResult.DEPRECATED, null);
-    }
-
-    /**
-     * Creates a new ValidationResult.
-     *
-     * @param owner owner
-     * @param key the name/model key
-     * @param type model type 
-     * @return a corresponding configModel item
-     */
-    public static Validation ofUndefined(final String owner, final String key, final ModelTarget type) {
-        return new Validation(new AbstractConfigModel(owner, key, false, "Undefined key: " + key) {
-
-            @Override
-            public ModelTarget getType() {
-                return type;
-            }
-
-            @Override
-            public Collection<Validation> validate(Configuration config) {
-                return Collections.emptyList();
-            }
-        }, ValidationResult.UNDEFINED, null);
-    }
-
-
-    /**
-     * Constructor.
-     *
-     * @param configModel the configModel item, not null.
-     * @param result     the configModel result, not null.
-     * @param message    the detail message.
-     * @return new validation result.
-     */
-    public static Validation of(ConfigModel configModel, ValidationResult result, String message) {
-        return new Validation(configModel, result, message);
-    }
-
-
-    /**
-     * Constructor.
-     *
-     * @param configModel the configModel item, not null.
-     * @param result     the configModel result, not null.
-     * @param message    the detail message.
-     */
-    private Validation(ConfigModel configModel, ValidationResult result, String message) {
-        this.message = message;
-        this.configModel = Objects.requireNonNull(configModel);
-        this.result = Objects.requireNonNull(result);
-    }
-
-    /**
-     * Get the configModel section.
-     *
-     * @return the section, never null.
-     */
-    public ConfigModel getConfigModel() {
-        return configModel;
-    }
-
-    /**
-     * Get the configModel result.
-     *
-     * @return the result, never null.
-     */
-    public ValidationResult getResult() {
-        return result;
-    }
-
-    /**
-     * Get the detail message.
-     *
-     * @return the detail message, or null.
-     */
-    public String getMessage() {
-        return message;
-    }
-
-    @Override
-    public String toString() {
-        if (message != null) {
-            return result + ": " + configModel.getName() + " (" + configModel.getType() + ") -> " + message + '\n';
-        }
-        return result + ": " + configModel.getName() + " (" + configModel.getType() + ")";
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/ValidationResult.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/ValidationResult.java b/modules/model/src/main/java/org/apache/tamaya/model/ValidationResult.java
deleted file mode 100644
index d719f37..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/ValidationResult.java
+++ /dev/null
@@ -1,59 +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 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;
-
-/**
- * Enum type describing the different validation results supported.
- */
-public enum ValidationResult {
-    /**
-     * The validated item is valid
-     */
-    VALID,
-    /**
-     * The validated item is deprecated.
-     */
-    DEPRECATED,
-    /**
-     * The validated item is correct, but the value is worth a warning.
-     */
-    WARNING,
-    /**
-     * The given section or parameter is not a defined/validated item. It may be still valid, but typically,
-     * when validation is fully implemented, such a parameter or section should be removed.
-     */
-    UNDEFINED,
-    /**
-     * A required parameter or section is missing.
-     */
-    MISSING,
-    /**
-     * The validated item has an invalid value.
-     */
-    ERROR;
-
-    /**
-     * Method to quickly evaluate if the current state is an error state.
-     *
-     * @return true, if the state is not ERROR or MISSING.
-     */
-    boolean isError() {
-        return this.ordinal() == MISSING.ordinal() || this.ordinal() == ERROR.ordinal();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfigDocumentationBean.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfigDocumentationBean.java b/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfigDocumentationBean.java
deleted file mode 100644
index 3298025..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfigDocumentationBean.java
+++ /dev/null
@@ -1,197 +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 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.Configuration;
-import org.apache.tamaya.ConfigurationProvider;
-import org.apache.tamaya.model.ConfigModel;
-import org.apache.tamaya.model.ConfigModelManager;
-import org.apache.tamaya.model.ModelTarget;
-import org.apache.tamaya.model.Validation;
-import org.apache.tamaya.model.spi.ConfigDocumentationMBean;
-
-import javax.json.Json;
-import javax.json.JsonArray;
-import javax.json.JsonArrayBuilder;
-import javax.json.JsonObject;
-import javax.json.JsonObjectBuilder;
-import javax.json.JsonWriter;
-import javax.json.JsonWriterFactory;
-import javax.json.stream.JsonGenerator;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * MBean implementation of {@link ConfigDocumentationMBean}.
- */
-public class ConfigDocumentationBean implements ConfigDocumentationMBean{
-
-    private final JsonWriterFactory writerFactory;
-
-    private static final Comparator<Validation> COMPARATOR = new Comparator<Validation>() {
-        @Override
-        public int compare(Validation v1, Validation v2) {
-            int compare = VAL_COMPARATOR.compare(v1.getConfigModel(), v2.getConfigModel());
-            if(compare==0){
-                compare = v1.getResult().compareTo(v2.getResult());
-            }
-            if(compare==0){
-                return v1.getMessage().compareTo(v2.getMessage());
-            }
-            return compare;
-        }
-    };
-    private static final Comparator<ConfigModel> VAL_COMPARATOR = new Comparator<ConfigModel>() {
-        @Override
-        public int compare(ConfigModel v1, ConfigModel v2) {
-            int compare = v1.getType().compareTo(v2.getType());
-            if(compare==0){
-                compare = v1.getName().compareTo(v2.getName());
-            }
-            return compare;
-        }
-    };
-
-    private Configuration config;
-
-    /**
-     * Default constructor, using the current configuration being available.
-     */
-    public ConfigDocumentationBean(){
-        this(null);
-    }
-
-
-    /**
-     * Creates an mbean bound to the given configuration. This is useful, when multiple mbeans for each
-     * context should be used, e.g. one mbean per ear, app deployment.
-     * @param config the configuration to be used.
-     */
-    public ConfigDocumentationBean(Configuration config){
-        this.config = config;
-        Map<String, Object> writerProperties = new HashMap<>(1);
-        writerProperties.put(JsonGenerator.PRETTY_PRINTING, true);
-        writerFactory = Json.createWriterFactory(writerProperties);
-    }
-
-    /**
-     * Access the configuration.
-     * @return either the configuration bound to this bean, or the current configuration.
-     */
-    private Configuration getConfig(){
-        return config!=null?config: ConfigurationProvider.getConfiguration();
-    }
-
-    @Override
-    public String validate(boolean showUndefined) {
-        List<Validation> validations = new ArrayList<>(ConfigModelManager.validate(getConfig(), showUndefined));
-        Collections.sort(validations, COMPARATOR);
-        JsonArrayBuilder builder = Json.createArrayBuilder();
-        for(Validation val:validations){
-            builder.add(toJsonObject(val));
-        }
-        return formatJson(builder.build());
-    }
-
-
-
-    @Override
-    public String getConfigurationModel() {
-        List<ConfigModel> configModels = new ArrayList<>(ConfigModelManager.getModels());
-        Collections.sort(configModels, VAL_COMPARATOR);
-        JsonArrayBuilder result = Json.createArrayBuilder();
-        for(ConfigModel val: configModels){
-            result.add(toJsonObject(val));
-        }
-        return formatJson(result.build());
-    }
-
-    @Override
-    public String getConfigurationModel(ModelTarget type) {
-        return findValidationModels(".*", type);
-    }
-
-    @Override
-    public String findConfigurationModels(String namePattern) {
-        List<ConfigModel> configModels = new ArrayList<>(ConfigModelManager.findModels(namePattern));
-        Collections.sort(configModels, VAL_COMPARATOR);
-        JsonArrayBuilder result = Json.createArrayBuilder();
-        for(ConfigModel val: configModels){
-            result.add(toJsonObject(val));
-        }
-        return formatJson(result.build());
-    }
-
-    @Override
-    public String findValidationModels(String namePattern, ModelTarget... type) {
-        List<ConfigModel> configModels = new ArrayList<>(ConfigModelManager.findModels(namePattern, type));
-        Collections.sort(configModels, VAL_COMPARATOR);
-        JsonArrayBuilder result = Json.createArrayBuilder();
-        for(ConfigModel val: configModels){
-            result.add(toJsonObject(val));
-        }
-        return formatJson(result.build());
-    }
-
-    @Override
-    public String toString(){
-        return "ConfigDocumentationBean, config: " + (this.config!=null?this.config.toString():"<current>");
-    }
-
-
-    private JsonObject toJsonObject(ConfigModel val) {
-        JsonObjectBuilder valJson = Json.createObjectBuilder().add("target", val.getType().toString())
-                .add("name", val.getName());
-        if(val.getDescription()!=null) {
-            valJson.add("description", val.getDescription());
-        }
-        if(val.isRequired()){
-            valJson.add("required",true);
-        }
-        return valJson.build();
-    }
-
-    private JsonObject toJsonObject(Validation val) {
-        JsonObjectBuilder valJson = Json.createObjectBuilder().add("target", val.getConfigModel().getType().toString())
-                .add("name", val.getConfigModel().getName());
-        if(val.getConfigModel().isRequired()){
-            valJson.add("required",true);
-        }
-        if(val.getConfigModel().getDescription() != null){
-            valJson.add("description", val.getConfigModel().getDescription());
-        }
-        valJson.add("result", val.getResult().toString());
-        if( val.getMessage() != null) {
-            valJson.add("message", val.getMessage());
-        }
-        return valJson.build();
-    }
-
-    private String formatJson(JsonArray data) {
-        StringWriter writer = new StringWriter();
-        JsonWriter gen = writerFactory.createWriter(writer);
-        gen.writeArray(data);
-        return writer.toString();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java b/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java
deleted file mode 100644
index 2e4f379..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java
+++ /dev/null
@@ -1,69 +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 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.ConfigModel;
-import org.apache.tamaya.model.spi.ConfigModelReader;
-import org.apache.tamaya.model.spi.ModelProviderSpi;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-
-/**
- * ConfigModel provider that reads model metadata from the current {@link org.apache.tamaya.Configuration}.
- */
-public class ConfiguredInlineModelProviderSpi implements ModelProviderSpi {
-
-    /** 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 configModels read. */
-    private List<ConfigModel> configModels = new ArrayList<>();
-
-
-    /**
-     * Constructor, typically called by the {@link java.util.ServiceLoader}.
-     */
-    public ConfiguredInlineModelProviderSpi() {
-        String enabledVal = ConfigurationProvider.getConfiguration().get(MODEL_EANABLED_PARAM);
-        boolean enabled = enabledVal == null || "true".equalsIgnoreCase(enabledVal);
-        if (enabled) {
-            LOG.info("Reading model configuration from config...");
-            Map<String,String> config = ConfigurationProvider.getConfiguration().getProperties();
-            String owner = config.get("_model.provider");
-            if(owner==null){
-                owner = config.toString();
-            }
-            configModels.addAll(ConfigModelReader.loadValidations(owner, config));
-        }
-        configModels = Collections.unmodifiableList(configModels);
-    }
-
-
-    public Collection<ConfigModel> getConfigModels() {
-        return configModels;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesModelProviderSpi.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesModelProviderSpi.java b/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesModelProviderSpi.java
deleted file mode 100644
index 57af99c..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesModelProviderSpi.java
+++ /dev/null
@@ -1,154 +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 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.ConfigModel;
-import org.apache.tamaya.model.spi.ConfigModelReader;
-import org.apache.tamaya.model.spi.ModelProviderSpi;
-import org.apache.tamaya.spisupport.MapPropertySource;
-
-import java.io.InputStream;
-import java.net.URL;
-import java.util.*;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * ConfigModel 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.configModels=org.apache.tamaya.model.TestValidator
- * </pre>
- */
-public class ConfiguredPropertiesModelProviderSpi implements ModelProviderSpi {
-
-    /** The logger. */
-    private static final Logger LOG = Logger.getLogger(ConfiguredPropertiesModelProviderSpi.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 configModels read. */
-    private List<ConfigModel> configModels = new ArrayList<>();
-
-    public ConfiguredPropertiesModelProviderSpi() {
-        String enabledVal = ConfigurationProvider.getConfiguration().get(MODEL_EANABLED_PARAM);
-        boolean enabled = enabledVal == null || "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();
-                try (InputStream is = config.openStream()) {
-                    Properties props = new Properties();
-                    props.load(is);
-                    Map<String,String> data = MapPropertySource.getMap(props);
-                    String owner = data.get("_model.owner");
-                    if(owner==null){
-                        owner = config.toString();
-                    }
-                    configModels.addAll(ConfigModelReader.loadValidations(owner,
-                            data));
-                } 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);
-        }
-        configModels = Collections.unmodifiableList(configModels);
-    }
-
-
-    public Collection<ConfigModel> getConfigModels() {
-        return configModels;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredResourcesModelProviderSpi.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredResourcesModelProviderSpi.java b/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredResourcesModelProviderSpi.java
deleted file mode 100644
index 85f2ac7..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredResourcesModelProviderSpi.java
+++ /dev/null
@@ -1,160 +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 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 java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.*;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tamaya.ConfigurationProvider;
-import org.apache.tamaya.format.ConfigurationData;
-import org.apache.tamaya.format.ConfigurationFormats;
-import org.apache.tamaya.model.ConfigModel;
-import org.apache.tamaya.model.spi.ConfigModelReader;
-import org.apache.tamaya.model.spi.ModelProviderSpi;
-import org.apache.tamaya.resource.ConfigResources;
-
-/**
- * ConfigModel provider that reads model metadata from property files from
- * {@code classpath*:META-INF/configmodel.json} in the following format:
- * <pre>
- *  Example of a configuration metamodel expressed via YAML.
- *  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.
- * </pre>
- */
-public class ConfiguredResourcesModelProviderSpi implements ModelProviderSpi {
-
-    /**
-     * 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 final boolean AVAILABLE = checkAvailabilityFormats();
-    /**
-     * Initializes the flag showing if the resources module is present (optional).
-     */
-    private static final boolean RESOURCES_EXTENSION_AVAILABLE = checkAvailabilityResources();
-
-    /**
-     * The configModels read.
-     */
-    private List<ConfigModel> configModels = 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 (final 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 (final 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 {
-            final 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;
-            if (RESOURCES_EXTENSION_AVAILABLE) {
-                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 (final String resource : resources.split(",")) {
-                    if (!resource.trim().isEmpty()) {
-                        Enumeration<URL> configs;
-                        try {
-                            configs = getClass().getClassLoader().getResources(resource);
-                            while (configs.hasMoreElements()) {
-                                urls.add(configs.nextElement());
-                            }
-                        } catch (final IOException e) {
-                            Logger.getLogger(getClass().getName()).log(Level.SEVERE,
-                                    "Error evaluating config model locations from " + resource, e);
-                        }
-                    }
-                }
-            }
-            // Reading configs
-            for (final URL config : urls) {
-                try (InputStream is = config.openStream()) {
-                    final ConfigurationData data = ConfigurationFormats.readConfigurationData(config);
-                    Map<String,String> props = data.getCombinedProperties();
-                    String owner = props.get("_model.provider");
-                    if(owner==null){
-                        owner = config.toString();
-                    }
-                    configModels.addAll(ConfigModelReader.loadValidations(owner, props));
-                } catch (final Exception e) {
-                    Logger.getLogger(getClass().getName()).log(Level.SEVERE,
-                            "Error loading config model data from " + config, e);
-                }
-            }
-        }
-        configModels = Collections.unmodifiableList(configModels);
-    }
-
-
-    @Override
-    public Collection<ConfigModel> getConfigModels() {
-        return configModels;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredTypeEventsModelPopulator.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredTypeEventsModelPopulator.java b/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredTypeEventsModelPopulator.java
deleted file mode 100644
index f6169ad..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredTypeEventsModelPopulator.java
+++ /dev/null
@@ -1,90 +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 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.events.ConfigEvent;
-import org.apache.tamaya.events.ConfigEventListener;
-import org.apache.tamaya.inject.spi.ConfiguredField;
-import org.apache.tamaya.inject.spi.ConfiguredMethod;
-import org.apache.tamaya.inject.spi.ConfiguredType;
-import org.apache.tamaya.model.ConfigModelManager;
-import org.apache.tamaya.model.spi.ParameterModel;
-
-import java.util.Collection;
-import java.util.logging.Logger;
-
-/**
- * Internal facade that registers all kind of injected fields as {@link org.apache.tamaya.model.ConfigModel} entries,
- * so all configured injection points are visible as documented configuration hooks.
- */
-public final class ConfiguredTypeEventsModelPopulator implements ConfigEventListener {
-
-    /**
-     * The logger.
-     */
-    private static final Logger LOG = Logger.getLogger(ConfiguredTypeEventsModelPopulator.class.getName());
-
-    /** System property to be set to deactivate auto documentation of configured classes published thorugh
-     * ConfiguredType events.
-     */
-    private static final String ENABLE_EVENT_DOC = "org.apache.tamaya.model.autoModelEvents";
-
-    @Override
-    public void onConfigEvent(ConfigEvent event) {
-        if(event.getResourceType()!=ConfiguredType.class){
-            return;
-        }
-        String value = System.getProperty(ENABLE_EVENT_DOC);
-        if(value == null || Boolean.parseBoolean(value)) {
-            ConfiguredType confType = (ConfiguredType)event.getResource();
-            for (ConfiguredField field : confType.getConfiguredFields()) {
-                Collection<String> keys = field.getConfiguredKeys();
-                for (String key : keys) {
-                    ParameterModel val = ConfigModelManager.getModel(key, ParameterModel.class);
-                    if (val == null) {
-                        ConfiguredTypeEventsModelProvider.addConfigModel(
-                                new ParameterModel.Builder(confType.getName(), key)
-                                .setType(field.getType().getName())
-                                .setDescription("Injected field: " +
-                                        field.getAnnotatedField().getDeclaringClass().getName() + '.' + field.toString() +
-                                        ", \nconfigured with keys: " + keys)
-                                .build());
-                    }
-                }
-            }
-            for (ConfiguredMethod method : confType.getConfiguredMethods()) {
-                Collection<String> keys = method.getConfiguredKeys();
-                for (String key : keys) {
-                    ParameterModel val = ConfigModelManager.getModel(key, ParameterModel.class);
-                    if (val == null) {
-                        ConfiguredTypeEventsModelProvider.addConfigModel(
-                                new ParameterModel.Builder(confType.getName(), key)
-                                .setType(method.getParameterTypes()[0].getName())
-                                .setDescription("Injected field: " +
-                                        method.getAnnotatedMethod().getDeclaringClass().getName() + '.' + method.toString() +
-                                        ", \nconfigured with keys: " + keys)
-                                .build());
-                    }
-                }
-            }
-        }
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredTypeEventsModelProvider.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredTypeEventsModelProvider.java b/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredTypeEventsModelProvider.java
deleted file mode 100644
index f54f77a..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredTypeEventsModelProvider.java
+++ /dev/null
@@ -1,51 +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 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.model.ConfigModel;
-import org.apache.tamaya.model.spi.ModelProviderSpi;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Model provider that adds model definitions for the items published as
- * {@link org.apache.tamaya.inject.spi.ConfiguredType} events.
- */
-public class ConfiguredTypeEventsModelProvider implements ModelProviderSpi {
-    /** The collected models. */
-    private static Collection<ConfigModel> configModels = new ArrayList<>();
-
-    /**
-     * Adds a model, called from the registered listener class.
-     * @param configModel adds the config model.
-     */
-    static void addConfigModel(ConfigModel configModel){
-        List<ConfigModel> newList = new ArrayList<>(configModels);
-        newList.add(configModel);
-        ConfiguredTypeEventsModelProvider.configModels = newList;
-    }
-
-    @Override
-    public Collection<ConfigModel> getConfigModels() {
-        return Collections.unmodifiableCollection(configModels);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/internal/DefaultConfigUsageStats.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/internal/DefaultConfigUsageStats.java b/modules/model/src/main/java/org/apache/tamaya/model/internal/DefaultConfigUsageStats.java
deleted file mode 100644
index 8910eaf..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/internal/DefaultConfigUsageStats.java
+++ /dev/null
@@ -1,176 +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 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.model.Usage;
-import org.apache.tamaya.model.spi.ConfigUsageStatsSpi;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * Created by atsticks on 29.04.16.
- */
-public class DefaultConfigUsageStats implements ConfigUsageStatsSpi {
-
-    private Set<String> ignoredPackages = new HashSet<>();
-
-    private Map<String, Usage> usages = new ConcurrentHashMap<>();
-
-    /** By default usage tracking is not enabled. */
-    private boolean usageTrackingEnabled = initEnabled();
-
-    /**
-     * Method that checks the 'tamaya.usage-report' system property for
-     * enabling tamaya usage reporting initially.
-     * @return {@code true} iff property is set to {@code true}
-     */
-    private boolean initEnabled() {
-        String val = System.getProperty("tamaya.usage-report");
-        if(Boolean.parseBoolean(val)){
-            return true;
-        }
-        return false;
-    }
-
-    public DefaultConfigUsageStats(){
-        ignoredPackages.add("com.intellij");
-        ignoredPackages.add("java");
-        ignoredPackages.add("org.junit");
-        ignoredPackages.add("junit");
-        ignoredPackages.add("javax");
-        ignoredPackages.add("sun");
-        ignoredPackages.add("oracle");
-        ignoredPackages.add("com.sun");
-        ignoredPackages.add("com.oracle");
-        ignoredPackages.add("org.apache.tamaya");
-    }
-
-    @Override
-    public void enableUsageTracking(boolean enabled){
-        this.usageTrackingEnabled = enabled;
-    }
-
-    @Override
-    public boolean isUsageTrackingEnabled(){
-        return usageTrackingEnabled;
-    }
-
-    @Override
-    public Set<String> getIgnoredPackages() {
-        return Collections.unmodifiableSet(ignoredPackages);
-    }
-
-    @Override
-    public void addIgnoredUsagePackages(String... packageName) {
-
-    }
-
-    @Override
-    public Usage getUsage(String key) {
-        return this.usages.get(key);
-    }
-
-    @Override
-    public Usage getUsageAllProperties() {
-        return this.usages.get("<<all>>");
-    }
-
-    /**
-     * Get the recorded usage references of configuration.
-     * @return the recorded usge references, never null.
-     */
-    @Override
-    public Collection<Usage> getUsages() {
-        return usages.values();
-    }
-
-    @Override
-    public void trackAllPropertiesAccess(){
-        trackSingleKeyAccess("<<all>>", "<not stored>");
-    }
-
-    @Override
-    public void trackSingleKeyAccess(String key, String value){
-        // Ignore meta-entries
-        if(!isUsageTrackingEnabled() || key.startsWith("_")){
-            return;
-        }
-        Usage usage = this.usages.get(key);
-        if(usage==null){
-            usage = new Usage(key);
-            this.usages.put(key, usage);
-        }
-        usage.trackUsage(value);
-    }
-
-
-    /**
-     * Access the usage statistics for the recorded uses of configuration.
-     */
-    @Override
-    public String getUsageInfo(){
-        StringBuilder b = new StringBuilder();
-        b.append("Apache Tamaya Configuration Usage Metrics\n");
-        b.append("=========================================\n");
-        b.append("DATE: ").append(new Date()).append("\n\n");
-        List<Usage> usages = new ArrayList<>(getUsages());
-        Collections.sort(usages, new Comparator<Usage>() {
-            @Override
-            public int compare(Usage k1, Usage k2) {
-                return k2.getUsageCount() - k1.getUsageCount();
-            }
-        });
-        for(Usage usage:usages){
-            String usageCount = String.valueOf(usage.getUsageCount());
-            b.append(usageCount);
-            b.append("       ".substring(0, 7-usageCount.length()));
-            b.append(usage.getKey()).append(":\n");
-            for(Usage.AccessDetail details: usage.getAccessDetails()) {
-                String accessCount = String.valueOf(details.getAccessCount());
-                    b.append("  - ").append(accessCount);
-                    b.append("      ".substring(0, 6-usageCount.length()));
-                    b.append(details.getAccessPoint());
-                    int endIndex = 50-details.getAccessPoint().length();
-                    if(endIndex<0){
-                        endIndex = 0;
-                    }
-                    b.append("                                                  ".substring(0, endIndex));
-                    b.append(",");b.append(" first=").append(new Date(details.getFirstAccessTS()))
-                            .append(",");b.append(" last=").append(new Date(details.getLastAccessTS()))
-                            .append('\n');
-            }
-        }
-        return b.toString();
-    }
-
-    @Override
-    public void clearUsageStats() {
-        this.usages.clear();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/internal/UsageTrackerFilter.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/internal/UsageTrackerFilter.java b/modules/model/src/main/java/org/apache/tamaya/model/internal/UsageTrackerFilter.java
deleted file mode 100644
index d27491e..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/internal/UsageTrackerFilter.java
+++ /dev/null
@@ -1,46 +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 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.model.spi.ConfigUsageStatsSpi;
-import org.apache.tamaya.spi.FilterContext;
-import org.apache.tamaya.spi.PropertyFilter;
-import org.apache.tamaya.spi.ServiceContextManager;
-
-import javax.annotation.Priority;
-
-/**
- * Configuration filter to be applied at the end of the filter chain. This filter
- * actually does not change the current filter value, but use the filter process
- * to track configuration usage.
- */
-@Priority(Integer.MAX_VALUE)
-public class UsageTrackerFilter implements PropertyFilter{
-
-    @Override
-    public String filterProperty(String value, FilterContext context) {
-            ConfigUsageStatsSpi tracker = ServiceContextManager.getServiceContext().getService(ConfigUsageStatsSpi.class);
-        if (context.isSinglePropertyScoped()) {
-            tracker.trackSingleKeyAccess(context.getKey(), value);
-        } else {
-            tracker.trackAllPropertiesAccess();
-        }
-        return value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/spi/AbstractConfigModel.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/spi/AbstractConfigModel.java b/modules/model/src/main/java/org/apache/tamaya/model/spi/AbstractConfigModel.java
deleted file mode 100644
index 9cc746a..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/spi/AbstractConfigModel.java
+++ /dev/null
@@ -1,88 +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 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.ConfigModel;
-
-import java.util.Objects;
-
-/**
- * Default configuration Model for a configuration area.
- */
-public abstract class AbstractConfigModel implements ConfigModel, Comparable<ConfigModel> {
-    private final String owner;
-    private final String name;
-    private final String description;
-    private boolean required = false;
-
-
-    protected AbstractConfigModel(String owner, String name, boolean required, String description) {
-        this.name = Objects.requireNonNull(name);
-        this.owner = Objects.requireNonNull(owner);
-        this.description = description;
-        this.required = required;
-    }
-
-    @Override
-    public String getOwner() {
-        return owner;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public String getDescription() {
-        return description;
-    }
-
-    @Override
-    public boolean isRequired() {
-        return required;
-    }
-
-    @Override
-    public int compareTo(ConfigModel configModel) {
-        int compare = getType().compareTo(configModel.getType());
-        if (compare != 0) {
-            return compare;
-        }
-        return getName().compareTo(configModel.getName());
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) {
-            return true;
-        }
-        if (o == null || getClass() != o.getClass()) {
-            return false;
-        }
-        AbstractConfigModel that = (AbstractConfigModel) o;
-        return getType().equals(that.getType()) && name.equals(that.name);
-
-    }
-
-    @Override
-    public int hashCode() {
-        return getType().hashCode() + name.hashCode();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/spi/ConfigDocumentationMBean.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/spi/ConfigDocumentationMBean.java b/modules/model/src/main/java/org/apache/tamaya/model/spi/ConfigDocumentationMBean.java
deleted file mode 100644
index f5636dc..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/spi/ConfigDocumentationMBean.java
+++ /dev/null
@@ -1,53 +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 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.ModelTarget;
-
-/**
- * JMX Management bean for accessing current configuration information
- */
-public interface ConfigDocumentationMBean {
-    /**
-     * Validates the configuration for the given context.
-     *
-     * @param showUndefined allows filtering for undefined configuration elements.
-     * @return the validation results, never null.
-     */
-    String validate(boolean showUndefined);
-
-    String getConfigurationModel();
-
-    String getConfigurationModel(ModelTarget type);
-
-    /**
-     * Find the validations by checking the validation's name using the given regular expression.
-     * @param namePattern the regular expression to use, not null.
-     * @return the sections defined, never null.
-     */
-    String findConfigurationModels(String namePattern);
-
-    /**
-     * Find the validations by checking the validation's name using the given regular expression.
-     * @param type the target ModelTypes (optional), not null.
-     * @param namePattern the regular expression to use, not null.
-     * @return the sections defined, never null.
-     */
-    String findValidationModels(String namePattern, ModelTarget... type);
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/spi/ConfigModelReader.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/spi/ConfigModelReader.java b/modules/model/src/main/java/org/apache/tamaya/model/spi/ConfigModelReader.java
deleted file mode 100644
index 72eb7d4..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/spi/ConfigModelReader.java
+++ /dev/null
@@ -1,144 +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 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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tamaya.model.ConfigModel;
-
-/**
- * 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 ConfigModelReader {
-
-    /** 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";
-
-    /**
-     * Utility class only.
-     */
-    private ConfigModelReader(){}
-
-
-    /**
-     * Loads validations as configured in the given properties.
-     * @param owner owner, not null.
-     * @param props the properties to be read
-     * @return a collection of config validations.
-     */
-    public static Collection<ConfigModel> loadValidations(String owner, Map<String,String> props) {
-        List<ConfigModel> result = new ArrayList<>();
-        Set<String> itemKeys = new HashSet<>();
-        for (Object key : props.keySet()) {
-            if (key.toString().startsWith("_") &&
-                    key.toString().endsWith(DEFAULT_META_INFO_SELECTOR + ".target")) {
-                itemKeys.add(key.toString().substring(0, key.toString().length() - ".model.target".length()));
-            }
-        }
-        for (String baseKey : itemKeys) {
-            String target = props.get(baseKey + ".model.target");
-            String type = props.get(baseKey + ".model.type");
-            if (type == null) {
-                type = String.class.getName();
-            }
-            String value = props.get(baseKey + ".model.transitive");
-            boolean transitive = false;
-            if(value!=null) {
-                transitive = Boolean.parseBoolean(value);
-            }
-            String description = props.get(baseKey + ".model.description");
-            String regEx = props.get(baseKey + ".model.expression");
-            String validations = props.get(baseKey + ".model.validations");
-            String requiredVal = props.get(baseKey + ".model.required");
-            String targetKey = baseKey.substring(1);
-            if ("Parameter".equalsIgnoreCase(target)) {
-                result.add(createParameterValidation(owner, targetKey,
-                        description, type, requiredVal, regEx, validations));
-            } else if ("Section".equalsIgnoreCase(target)) {
-                if(transitive){
-                    result.add(createSectionValidation(owner, targetKey+".*",
-                            description, requiredVal, validations));
-                } else {
-                    result.add(createSectionValidation(owner, targetKey,
-                            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 ConfigModel createParameterValidation(String owner, String paramName, String description, String type, String reqVal,
-                                                         String regEx, String validations) {
-        boolean required = "true".equalsIgnoreCase(reqVal);
-        ParameterModel.Builder builder = ParameterModel.builder(owner, paramName).setRequired(required)
-                .setDescription(description).setExpression(regEx).setType(type);
-//        if (validations != null) {
-//            try {
-//                // TODO define validator API
-////                builder.addValidations(loadValidations(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 ConfigModel createSectionValidation(String owner, String sectionName, String description, String reqVal,
-                                                       String validations) {
-        boolean required = "true".equalsIgnoreCase(reqVal);
-        SectionModel.Builder builder = SectionModel.builder(owner, sectionName).setRequired(required)
-                .setDescription(description);
-//        if (validations != null) {
-//            try {
-//                // TODO define validator API
-////                builder.addValidations(loadValidations(valiadtions));
-//            } 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/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/spi/ConfigUsageStatsSpi.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/spi/ConfigUsageStatsSpi.java b/modules/model/src/main/java/org/apache/tamaya/model/spi/ConfigUsageStatsSpi.java
deleted file mode 100644
index 5617b73..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/spi/ConfigUsageStatsSpi.java
+++ /dev/null
@@ -1,101 +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 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.Usage;
-
-import java.util.Collection;
-import java.util.Set;
-
-/**
- * SPI to be implemented by the component responsible for usage tracking of
- * configuration.
- */
-public interface ConfigUsageStatsSpi {
-
-    /**
-     * Enables/disables usage tracking.
-     * @param enable set to true to enable usage tracking.
-     */
-    void enableUsageTracking(boolean enable);
-
-    /**
-     * Allows to check if usage tracking is enabled (should be disbled by default).
-     * @return true, if usage tracking is enabled.
-     */
-    boolean isUsageTrackingEnabled();
-
-    /**
-     * Get the list of packages, which are not evaluated for tracking configuration access and usage statistics.
-     * @return the set of ignored package names.
-     */
-    Set<String> getIgnoredPackages();
-
-    /**
-     * Adds the given packageNames to the list of packages to be ignored when collecting usage data.
-     * @param packageName the package names to be added, not null.
-     */
-    void addIgnoredUsagePackages(String... packageName);
-
-    /**
-     * Access the usage statistics for a given key. If usage stats collection is not
-     * activated (default), this method returns null.
-     * @param key the fully qualified configuration key, not null.
-     * @return the stats collected, or null.
-     */
-    Usage getUsage(String key);
-
-    /**
-     * Access the usage statistics for accessing {@link org.apache.tamaya.Configuration#getProperties()}.
-     * If usage stats collection is not activated (default), this method returns null.
-     * @return the stats collected, or null.
-     */
-    Usage getUsageAllProperties();
-
-    /**
-     * Get the recorded usage references of configuration.
-     * @return the recorded usge references, never null.
-     */
-    Collection<Usage> getUsages();
-
-    /**
-     * Track the access of {@code Configuration#getProperties()} for
-     * usage statistics.
-     */
-    void trackAllPropertiesAccess();
-
-    /**
-     * Track the access of {@code Configuration#get(String)} for
-     * usage statistics.
-     * @param key key to track for
-     * @param value value to track for
-     */
-    void trackSingleKeyAccess(String key, String value);
-
-    /**
-     * Access the usage statistics for the recorded uses of configuration.
-     * @return usage statistics info
-     */
-    String getUsageInfo();
-
-    /**
-     * Clears all collected usage statistics.
-     */
-    void clearUsageStats();
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/spi/GroupModel.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/spi/GroupModel.java b/modules/model/src/main/java/org/apache/tamaya/model/spi/GroupModel.java
deleted file mode 100644
index 0a38dda..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/spi/GroupModel.java
+++ /dev/null
@@ -1,110 +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 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.Configuration;
-import org.apache.tamaya.model.ConfigModel;
-import org.apache.tamaya.model.ModelTarget;
-import org.apache.tamaya.model.Validation;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * Default configuration Model for a configuration area.
- */
-public class GroupModel implements ConfigModel {
-
-    private final String owner;
-    private final String name;
-    private boolean required;
-    private List<ConfigModel> childModels = new ArrayList<>();
-
-    public GroupModel(String owner, String name, ConfigModel... configModels){
-        this(owner, name, Arrays.asList(configModels));
-    }
-
-    public GroupModel(String owner, String name, Collection<ConfigModel> configModels){
-        this.owner = Objects.requireNonNull(owner);
-        this.name = Objects.requireNonNull(name);
-        this.childModels.addAll(configModels);
-        this.childModels = Collections.unmodifiableList(childModels);
-        for(ConfigModel val: configModels) {
-            if(val.isRequired()){
-                this.required = true;
-                break;
-            }
-        }
-    }
-
-    @Override
-    public String getOwner() {
-        return owner;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public boolean isRequired() {
-        return required;
-    }
-
-    @Override
-    public ModelTarget getType() {
-        return ModelTarget.Group;
-    }
-
-    @Override
-    public String getDescription() {
-        if(childModels.isEmpty()){
-            return null;
-        }
-        StringBuilder b = new StringBuilder();
-        for(ConfigModel val: childModels){
-            b.append("  >> ").append(val);
-        }
-        return b.toString();
-    }
-
-    public Collection<ConfigModel> getValidations(){
-        return childModels;
-    }
-
-    @Override
-    public Collection<Validation> validate(Configuration config) {
-        List<Validation> result = new ArrayList<>(1);
-        for(ConfigModel child: childModels){
-            result.addAll(child.validate(config));
-        }
-        return result;
-    }
-
-    @Override
-    public String toString(){
-        return String.valueOf(getType()) + ", size: " + childModels.size() + ": " + getDescription();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/spi/ModelProviderSpi.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/spi/ModelProviderSpi.java b/modules/model/src/main/java/org/apache/tamaya/model/spi/ModelProviderSpi.java
deleted file mode 100644
index 01c0979..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/spi/ModelProviderSpi.java
+++ /dev/null
@@ -1,39 +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 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.ConfigModel;
-
-import java.util.Collection;
-
-/**
- * Model of a configuration state. A model can be a full model, or a partial model, validating only
- * a configuration subset. This allows better user feedback because big configurations can be grouped
- * and validated by multiple (partial) models.
- */
-public interface ModelProviderSpi {
-
-    /**
-     * Get the validation defined.
-     *
-     * @return the sections defined, never null.
-     */
-    Collection<ConfigModel> getConfigModels();
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/model/src/main/java/org/apache/tamaya/model/spi/ParameterModel.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/spi/ParameterModel.java b/modules/model/src/main/java/org/apache/tamaya/model/spi/ParameterModel.java
deleted file mode 100644
index 46f0560..0000000
--- a/modules/model/src/main/java/org/apache/tamaya/model/spi/ParameterModel.java
+++ /dev/null
@@ -1,242 +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 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.Configuration;
-import org.apache.tamaya.model.ConfigModel;
-import org.apache.tamaya.model.ModelTarget;
-import org.apache.tamaya.model.Validation;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Objects;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Default configuration Model for a configuration parameter.
- */
-public class ParameterModel extends AbstractConfigModel {
-    /** Optional regular expression for validating the value. */
-    private final String regEx;
-    /** The target type into which the value must be convertible. */
-    private final Class<?> type;
-
-    /**
-     * Internal constructor.
-     * @param builder the builder, not null.
-     */
-    protected ParameterModel(Builder builder) {
-        super(builder.owner, builder.name, builder.required, builder.description);
-        this.regEx = builder.regEx;
-        this.type = builder.type;
-    }
-
-    @Override
-    public ModelTarget getType() {
-        return ModelTarget.Parameter;
-    }
-
-    /**
-     * Get the required parameter type.
-     *
-     * @return the type.
-     */
-    public Class<?> getParameterType() {
-        return type;
-    }
-
-    @Override
-    public Collection<Validation> validate(Configuration config) {
-        List<Validation> result = new ArrayList<>(1);
-        String configValue = config.get(getName());
-        if (configValue == null && isRequired()) {
-            result.add(Validation.ofMissing(this));
-        }
-        if (configValue != null && regEx != null) {
-            if (!configValue.matches(regEx)) {
-                result.add(Validation.ofError(this, "Config value not matching expression: " + regEx + ", was " +
-                        configValue));
-            }
-        }
-        return result;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder b = new StringBuilder();
-        b.append(getType()).append(": ").append(getName());
-        if (isRequired()) {
-            b.append(", required: ").append(isRequired());
-        }
-        if (regEx != null) {
-            b.append(", expression: ").append(regEx);
-        }
-        return b.toString();
-    }
-
-    /**
-     * Creates a new Builder instance.
-     * @param owner the owner name, not null.
-     * @param name the fully qualified parameter name.
-     * @return a new builder, never null.
-     */
-    public static Builder builder(String owner, String name) {
-        return new Builder(owner, name);
-    }
-
-    /**
-     * Creates a new ConfigModel
-     * @param owner the owner name, not null.
-     * @param name the fully qualified parameter name.
-     * @param required the required flag.
-     * @param expression an optional regular expression to validate a value.
-     * @return the new ConfigModel instance.
-     */
-    public static ConfigModel of(String owner, String name, boolean required, String expression) {
-        return new Builder(owner, name).setRequired(required).setExpression(expression).build();
-    }
-
-    /**
-     * Creates a new ConfigModel
-     * @param owner the owner name, not null.
-     * @param name the fully qualified parameter name.
-     * @param required the required flag.
-     * @return the new ConfigModel instance.
-     */
-    public static ConfigModel of(String owner, String name, boolean required) {
-        return new Builder(owner, name).setRequired(required).build();
-    }
-
-    /**
-     * Creates a new ConfigModel. The parameter will be defined as optional.
-     * @param owner the owner name, not null.
-     * @param name the fully qualified parameter name.
-     * @return the new ConfigModel instance.
-     */
-    public static ConfigModel of(String owner, String name) {
-        return new Builder(owner, name).setRequired(false).build();
-    }
-
-
-    /**
-     * A new Builder for creating ParameterModel instances.
-     */
-    public static class Builder {
-        /** The parameter's target type. */
-        private Class<?> type;
-        /** The owner. */
-        private String owner;
-        /** The fully qualified parameter name. */
-        private String name;
-        /** The optional validation expression. */
-        private String regEx;
-        /** The optional description. */
-        private String description;
-        /** The required flag. */
-        private boolean required;
-
-        /**
-         * Creates a new Builder.
-         * @param owner owner, not null.
-         * @param name the fully qualified parameter name, not null.
-         */
-        public Builder(String owner, String name) {
-            this.owner = Objects.requireNonNull(owner);
-            this.name = Objects.requireNonNull(name);
-        }
-
-        /**
-         * Sets the target type.
-         * @param type the type, not null.
-         * @return the Builder for chaining
-         */
-        public Builder setType(String type) {
-            try {
-                this.type = Class.forName(type);
-            } catch (ClassNotFoundException e) {
-                try {
-                    this.type = Class.forName("java.ui.lang."+type);
-                } catch (ClassNotFoundException e2) {
-                    Logger.getLogger(getClass().getName()).log(Level.INFO, "Failed to load parameter type: " + type, e2);
-                }
-            }
-            return this;
-        }
-
-        /**
-         * Sets the required flag.
-         * @param required the required flag.
-         * @return the Builder for chaining
-         */
-        public Builder setRequired(boolean required) {
-            this.required = required;
-            return this;
-        }
-
-        /**
-         * Sets the optional description
-         * @param description the description
-         * @return the Builder for chaining
-         */
-        public Builder setDescription(String description) {
-            this.description = description;
-            return this;
-        }
-
-        /**
-         * Sets the optional validation expression
-         * @param expression the validation expression
-         * @return the Builder for chaining
-         */
-        public Builder setExpression(String expression) {
-            this.regEx = expression;
-            return this;
-        }
-
-        /**
-         * Sets the owner name.
-         * @param owner the owner name, not null.
-         * @return the Builder for chaining
-         */
-        public Builder setOwner(String owner) {
-            this.owner = Objects.requireNonNull(owner);
-            return this;
-        }
-
-        /**
-         * Sets the fully qualified parameter name.
-         * @param name the fully qualified parameter name, not null.
-         * @return the Builder for chaining
-         */
-        public Builder setName(String name) {
-            this.name = Objects.requireNonNull(name);
-            return this;
-        }
-
-        /**
-         * Creates a new ConfigModel with the given parameters.
-         * @return a new ConfigModel , never null.
-         */
-        public ConfigModel build() {
-            return new ParameterModel(this);
-        }
-    }
-}


Mime
View raw message