All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tngtech.configbuilder.configuration.BuilderConfiguration Maven / Gradle / Ivy

Go to download

The Config Builder creates fully configured instances of config classes, using values from various sources like properties files, command line arguments etc.

There is a newer version: 1.8.1
Show newest version
package com.tngtech.configbuilder.configuration;

import com.tngtech.configbuilder.annotation.valueextractor.*;
import org.apache.commons.cli.CommandLine;

import java.lang.annotation.Annotation;
import java.util.Properties;

/**
 * Stores the configuration for the ConfigBuilder, i.e. the CommandLine, the Properties and the global annotation processing order.
 */
public class BuilderConfiguration {

    private Properties properties;
    private CommandLine commandLine;
    private Object importedConfiguration;
    private Class[] annotationOrder = new Class[]{CommandLineValue.class, PropertyValue.class, EnvironmentVariableValue.class, SystemPropertyValue.class, ImportedValue.class, DefaultValue.class};
    private String[] propertyNamePrefixes = new String[]{""};

    public BuilderConfiguration() {
        properties = new Properties();
        commandLine = null;
        importedConfiguration = null;
    }

    public CommandLine getCommandLine() {
        return commandLine;
    }

    public Properties getProperties() {
        return properties;
    }

    public Object getImportedConfiguration() {
        return importedConfiguration;
    }

    public void setProperties(Properties properties) {
        this.properties = properties;
    }

    public void setCommandLine(CommandLine commandLine) {
        this.commandLine = commandLine;
    }

    public void setImportedConfiguration(Object importedConfiguration) {
        this.importedConfiguration = importedConfiguration;
    }

    public void setAnnotationOrder(Class[] annotationOrder) {
        this.annotationOrder = annotationOrder;
    }

    public Class[] getAnnotationOrder() {
        return annotationOrder;
    }

    public void setPropertyNamePrefixes(String[] propertyNamePrefixes) {
        this.propertyNamePrefixes = propertyNamePrefixes;
    }

    public String[] getPropertyNamePrefixes() {
        return propertyNamePrefixes;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy