|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.openjpa.lib.conf.Configurations
public class Configurations
Utility methods dealing with configuration.
Constructor Summary | |
---|---|
Configurations()
|
Method Summary | |
---|---|
static void |
configureInstance(java.lang.Object obj,
Configuration conf,
java.util.Properties properties)
Configures the given object with the given properties by matching the properties string to the object's setter methods. |
static void |
configureInstance(java.lang.Object obj,
Configuration conf,
java.util.Properties properties,
java.lang.String configurationName)
Configures the given object with the given properties by matching the properties string to the object's setter methods. |
static void |
configureInstance(java.lang.Object obj,
Configuration conf,
java.lang.String properties)
Configures the given object with the given properties by matching the properties string to the object's setter methods. |
static void |
configureInstance(java.lang.Object obj,
Configuration conf,
java.lang.String properties,
java.lang.String configurationName)
Configures the given object with the given properties by matching the properties string to the object's setter methods. |
static java.lang.String |
getClassName(java.lang.String plugin)
Return the class name from the given plugin string, or null if none. |
static java.lang.String |
getPlugin(java.lang.String clsName,
java.lang.String props)
Combine the given class name and properties into a plugin string. |
static java.lang.String |
getProperties(java.lang.String plugin)
Return the properties part of the given plugin string, or null if none. |
static ConfigurationProvider |
load(java.io.File file,
java.lang.ClassLoader loader)
Return a ConfigurationProvider that has parsed the given
file. |
static ConfigurationProvider |
load(java.lang.String resource,
java.lang.ClassLoader loader)
Return a ConfigurationProvider that has parsed the given
resource. |
static ConfigurationProvider |
loadDefaults(java.lang.ClassLoader loader)
Return a ConfigurationProvider that has parsed system defaults. |
static java.lang.Object |
lookup(java.lang.String name)
Looks up the given name in JNDI. |
static java.lang.Object |
newInstance(java.lang.String clsName,
java.lang.ClassLoader loader)
Create the instance with the given class name, using the given class loader. |
static java.lang.Object |
newInstance(java.lang.String clsName,
Configuration conf,
java.lang.String props,
java.lang.ClassLoader loader)
Create and configure an instance with the given class name and properties. |
static Options |
parseProperties(java.lang.String properties)
Parse a set of properties from a comma-separated string. |
static void |
populateConfiguration(Configuration conf,
Options opts)
Set the given Configuration instance from the command line
options provided. |
static java.lang.String |
serializeProperties(java.util.Map map)
Turn a set of properties into a comma-separated string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Configurations()
Method Detail |
---|
public static java.lang.String getClassName(java.lang.String plugin)
public static java.lang.String getProperties(java.lang.String plugin)
public static java.lang.String getPlugin(java.lang.String clsName, java.lang.String props)
public static java.lang.Object newInstance(java.lang.String clsName, java.lang.ClassLoader loader)
public static java.lang.Object newInstance(java.lang.String clsName, Configuration conf, java.lang.String props, java.lang.ClassLoader loader)
public static void configureInstance(java.lang.Object obj, Configuration conf, java.lang.String properties)
java.lang.RuntimeException
- on configuration errorpublic static void configureInstance(java.lang.Object obj, Configuration conf, java.lang.String properties, java.lang.String configurationName)
java.lang.RuntimeException
- on configuration errorpublic static void configureInstance(java.lang.Object obj, Configuration conf, java.util.Properties properties)
java.lang.RuntimeException
- on configuration errorpublic static void configureInstance(java.lang.Object obj, Configuration conf, java.util.Properties properties, java.lang.String configurationName)
configurationName
is
non-null
, validates that setter methods exist for
the properties.
java.lang.RuntimeException
- on configuration errorpublic static java.lang.String serializeProperties(java.util.Map map)
public static Options parseProperties(java.lang.String properties)
public static void populateConfiguration(Configuration conf, Options opts)
Configuration
instance from the command line
options provided. All property names of the given configuration are
recognized; additionally, if a properties
or
p
argument exists, the resource it
points to will be loaded and set into the given configuration instance.
It can point to either a file or a resource name.
public static ConfigurationProvider loadDefaults(java.lang.ClassLoader loader)
ConfigurationProvider
that has parsed system defaults.
public static ConfigurationProvider load(java.lang.String resource, java.lang.ClassLoader loader)
ConfigurationProvider
that has parsed the given
resource. Throws MissingResourceException
if resource does
not exist.
public static ConfigurationProvider load(java.io.File file, java.lang.ClassLoader loader)
ConfigurationProvider
that has parsed the given
file. Throws MissingResourceException
if file does not exist.
public static java.lang.Object lookup(java.lang.String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |