org.dbmaintain.config
Class ConfigUtils
java.lang.Object
org.dbmaintain.config.ConfigUtils
public class ConfigUtils
- extends Object
Class containing configuration related utilities
- Author:
- Filip Neven, Tim Ducheyne
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConfigUtils
public ConfigUtils()
getConfiguredClass
public static <T> Class<T> getConfiguredClass(Class<T> type,
Properties configuration,
String... implementationDiscriminatorValues)
- Retrieves the concrete instance of the class with the given type as configured by the given
Configuration
.
Tries to retrieve a specific implementation first (propery key = fully qualified name of the interface
type + '.impl.className.' + implementationDiscriminatorValue). If this key does not exist, the generally configured
instance is retrieved (same property key without the implementationDiscriminatorValue).
- Parameters:
type
- The type of the instanceconfiguration
- The configuration containing the necessary properties for configuring the instanceimplementationDiscriminatorValues
- The values that define which specific implementation class should be used.
This is typically an environment specific property, like the DBMS that is used.
- Returns:
- The configured class name
getFactoryClass
public static <T> Class<T> getFactoryClass(Class<T> type,
Properties configuration,
String... implementationDiscriminatorValues)
Copyright © 2011. All Rights Reserved.