com.tngtech.configbuilder.configuration.BuilderConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of config-builder Show documentation
Show all versions of config-builder Show documentation
The Config Builder creates fully configured instances of config classes, using values from various sources like properties files, command line arguments etc.
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 extends Annotation>[] 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 extends Annotation>[] annotationOrder) {
this.annotationOrder = annotationOrder;
}
public Class extends Annotation>[] getAnnotationOrder() {
return annotationOrder;
}
public void setPropertyNamePrefixes(String[] propertyNamePrefixes) {
this.propertyNamePrefixes = propertyNamePrefixes;
}
public String[] getPropertyNamePrefixes() {
return propertyNamePrefixes;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy