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.

The 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 = new Properties();
    private CommandLine commandLine = null;
    private Object importedConfiguration = null;
    private Class[] annotationOrder = new Class[]{CommandLineValue.class, PropertyValue.class, EnvironmentVariableValue.class, SystemPropertyValue.class, ImportedValue.class, DefaultValue.class};
    private String[] propertyNamePrefixes = {""};

    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 - 2025 Weber Informatics LLC | Privacy Policy