|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.core.config.UnitilsConfiguration
org.unitils.core.config.Configuration
public class Configuration
todo javadoc
If classifiers are used, it will first look for a property using all classifiers, then look for a property without the last classifier etc. If still no property was found, it will look for the property without discriminators. E.g. suppose the property name is 'key' and there are 2 classifiers 'a' and 'b'. First it will look for a property with name 'key.a.b', if that doesn't exist it will look for 'key.a', and finally it will try 'key'.
| Field Summary | |
|---|---|
protected Properties |
overridingProperties
|
protected Properties |
properties
|
| Constructor Summary | |
|---|---|
Configuration(Properties properties)
Creates a configuration for the given properties. |
|
| Method Summary | ||
|---|---|---|
Properties |
getAllProperties()
|
|
Boolean |
getBoolean(String propertyName,
String... classifiers)
Gets the boolean value for the property with the given name. |
|
List<Boolean> |
getBooleanList(String propertyName,
String... classifiers)
Gets the list of comma separated boolean values for the property with the given name. |
|
Class<?> |
getClass(String propertyName,
String... classifiers)
Gets the class value for the property with the given name. |
|
List<Class<?>> |
getClassList(String propertyName,
String... classifiers)
Gets the list of comma separated class values for the property with the given name. |
|
|
getEnumList(Class<T> type,
String propertyName,
String... classifiers)
Gets the list of comma separated enum values for the property with the given name. |
|
|
getEnumValue(Class<T> type,
String propertyName,
String... classifiers)
Gets the enum value for the property with the given name. |
|
|
getInstanceOf(Class<T> type,
String... classifiers)
Gets an instance of the given type (typically an interface). |
|
|
getInstanceOfList(Class<T> type,
String... classifiers)
Gets the list of comma separated instances of the given type (typically an interface). |
|
Integer |
getInteger(String propertyName,
String... classifiers)
Gets the int value for the property with the given name. |
|
List<Integer> |
getIntegerList(String propertyName,
String... classifiers)
Gets the list of comma separated int values for the property with the given name. |
|
Long |
getLong(String propertyName,
String... classifiers)
Gets the long value for the property with the given name. |
|
List<Long> |
getLongList(String propertyName,
String... classifiers)
Gets the list of comma separated long values for the property with the given name. |
|
Boolean |
getOptionalBoolean(String propertyName,
String... classifiers)
Gets the boolean value for the property with the given name. |
|
List<Boolean> |
getOptionalBooleanList(String propertyName,
String... classifiers)
Gets the list of comma separated boolean values for the property with the given name. |
|
Class<?> |
getOptionalClass(String propertyName,
String... classifiers)
Gets the class value for the property with the given name. |
|
List<Class<?>> |
getOptionalClassList(String propertyName,
String... classifiers)
Gets the list of comma separated class values for the property with the given name. |
|
|
getOptionalEnumList(Class<T> type,
String propertyName,
String... classifiers)
Gets the list of comma separated enum values for the property with the given name. |
|
|
getOptionalEnumValue(Class<T> type,
String propertyName,
String... classifiers)
Gets the enum value for the property with the given name. |
|
|
getOptionalInstanceOf(Class<T> type,
String... classifiers)
Gets an instance of the given type (typically an interface). |
|
|
getOptionalInstanceOfList(Class<T> type,
String... classifiers)
Gets the list of comma separated instances of the given type (typically an interface). |
|
Integer |
getOptionalInteger(String propertyName,
String... classifiers)
Gets the int value for the property with the given name. |
|
List<Integer> |
getOptionalIntegerList(String propertyName,
String... classifiers)
Gets the list of comma separated int values for the property with the given name. |
|
Long |
getOptionalLong(String propertyName,
String... classifiers)
Gets the long value for the property with the given name. |
|
List<Long> |
getOptionalLongList(String propertyName,
String... classifiers)
Gets the list of comma separated long values for the property with the given name. |
|
String |
getOptionalString(String propertyName,
String... classifiers)
Gets the string value for the property with the given name. |
|
List<String> |
getOptionalStringList(String propertyName,
String... classifiers)
Gets the list of comma separated string values for the property with the given name. |
|
|
getOptionalValueListOfType(Class<T> type,
String propertyName,
String... classifiers)
|
|
|
getOptionalValueOfType(Class<T> type,
String propertyName,
String... classifiers)
|
|
Properties |
getOverridingProperties()
|
|
protected String |
getProperty(String propertyName)
|
|
String |
getString(String propertyName,
String... classifiers)
Gets the string value for the property with the given name. |
|
List<String> |
getStringList(String propertyName,
String... classifiers)
Gets the list of comma separated string values for the property with the given name. |
|
|
getValueListOfType(Class<T> type,
String propertyName,
String... classifiers)
|
|
|
getValueOfType(Class<T> type,
String propertyName,
String... classifiers)
|
|
protected String |
nameToString(String propertyName,
String... classifiers)
|
|
void |
setOverridingProperties(Properties overridingProperties)
|
|
protected Boolean |
toBoolean(String value,
String propertyName,
String... classifiers)
|
|
protected Class<?> |
toClass(String value,
String propertyName,
String[] classifiers)
|
|
protected
|
toEnum(Class<T> type,
String value,
String propertyName,
String[] classifiers)
|
|
protected
|
toInstance(Class<T> type,
String value,
String propertyName,
String... classifiers)
|
|
protected
|
toInstance(String value,
String propertyName,
String... classifiers)
|
|
protected Integer |
toInteger(String value,
String propertyName,
String... classifiers)
|
|
protected Long |
toLong(String value,
String propertyName,
String... classifiers)
|
|
protected List<String> |
toStringList(String value)
|
|
protected
|
toValueOfType(Class<T> type,
String value,
String propertyName,
String... classifiers)
|
|
| Methods inherited from class org.unitils.core.config.UnitilsConfiguration |
|---|
containsProperty, getBoolean, getBoolean, getInstance, getInstance, getInt, getInt, getLong, getLong, getProperties, getString, getString, getStringList, getStringList |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Properties properties
protected Properties overridingProperties
| Constructor Detail |
|---|
public Configuration(Properties properties)
properties - All configuration properties, not null| Method Detail |
|---|
public Properties getOverridingProperties()
public void setOverridingProperties(Properties overridingProperties)
public Properties getAllProperties()
public String getString(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public String getOptionalString(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public List<String> getStringList(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public List<String> getOptionalStringList(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public Boolean getBoolean(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public Boolean getOptionalBoolean(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public List<Boolean> getBooleanList(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public List<Boolean> getOptionalBooleanList(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public Integer getInteger(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public Integer getOptionalInteger(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public List<Integer> getIntegerList(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public List<Integer> getOptionalIntegerList(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public Long getLong(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public Long getOptionalLong(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public List<Long> getLongList(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public List<Long> getOptionalLongList(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public Class<?> getClass(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public Class<?> getOptionalClass(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public List<Class<?>> getClassList(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public List<Class<?>> getOptionalClassList(String propertyName,
String... classifiers)
propertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public <T> T getInstanceOf(Class<T> type,
String... classifiers)
getInstanceOf in class UnitilsConfigurationtype - The type of the instanceclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public <T> T getOptionalInstanceOf(Class<T> type,
String... classifiers)
type - The type of the instanceclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public <T> List<T> getInstanceOfList(Class<T> type,
String... classifiers)
type - The type of the instanceclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public <T> List<T> getOptionalInstanceOfList(Class<T> type,
String... classifiers)
type - The type of the instanceclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public <T extends Enum<T>> T getEnumValue(Class<T> type,
String propertyName,
String... classifiers)
type - The enum type, not nullpropertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public <T extends Enum<T>> T getOptionalEnumValue(Class<T> type,
String propertyName,
String... classifiers)
type - The enum type, not nullpropertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public <T extends Enum<T>> List<T> getEnumList(Class<T> type,
String propertyName,
String... classifiers)
type - The enum type, not nullpropertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public <T extends Enum<T>> List<T> getOptionalEnumList(Class<T> type,
String propertyName,
String... classifiers)
type - The enum type, not nullpropertyName - The name, not nullclassifiers - An optional list of classifiers for the property name (see class javadoc for more info)
public <T> T getValueOfType(Class<T> type,
String propertyName,
String... classifiers)
public <T> T getOptionalValueOfType(Class<T> type,
String propertyName,
String... classifiers)
public <T> List<T> getValueListOfType(Class<T> type,
String propertyName,
String... classifiers)
public <T> List<T> getOptionalValueListOfType(Class<T> type,
String propertyName,
String... classifiers)
protected String nameToString(String propertyName,
String... classifiers)
protected String getProperty(String propertyName)
protected Boolean toBoolean(String value,
String propertyName,
String... classifiers)
protected Integer toInteger(String value,
String propertyName,
String... classifiers)
protected Long toLong(String value,
String propertyName,
String... classifiers)
protected List<String> toStringList(String value)
protected <T extends Enum<T>> T toEnum(Class<T> type,
String value,
String propertyName,
String[] classifiers)
protected <T> T toInstance(String value,
String propertyName,
String... classifiers)
protected Class<?> toClass(String value,
String propertyName,
String[] classifiers)
protected <T> T toInstance(Class<T> type,
String value,
String propertyName,
String... classifiers)
protected <T> T toValueOfType(Class<T> type,
String value,
String propertyName,
String... classifiers)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||