|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectwave.configuration.DefaultConfigurationService
Set the values of the property object from the properties provided by the
property factory. By default it uses System.properties for configuration
but this could be overridden by other configuration services.
The rules for finding values from the properties object
is documented in the method definition of findValueToSet.
findValueToSet(java.lang.String, java.util.Properties, java.lang.String)
,
DefaultCreationStrategy
Nested Class Summary | |
static class |
DefaultConfigurationService.Test
|
Field Summary | |
protected PropertyObjects |
propertyObjects
|
protected ReflectiveHelper |
reflectiveHelper
|
Constructor Summary | |
DefaultConfigurationService()
Constructor for the DefaultConfigurationService object |
Method Summary | |
java.lang.String |
findValueToSet(java.lang.String name,
java.util.Properties props,
java.lang.String categoryId)
In the following example assume an attributeName of 'host' and a categoryId of 'com.objectwave.configuration.MyClass'. |
java.lang.String |
getCategoryId(PropertySource source)
Categories are identified by the full name of the property source object. |
protected java.lang.Object |
getOrCreateDetail(PropertySource context,
java.lang.String categoryId)
Either find the existing detail object, or create a new instance if an exsting one is not found. |
protected java.lang.String |
getPackageName(java.lang.String className)
Get the 'package name' from the class full name. |
java.lang.Object |
getPropertyHolder(PropertySource context)
Create and return an instance of the PropertyDetail. |
java.lang.Object |
getPropertyHolder(PropertySource context,
java.lang.String categoryId)
Create and return an instance of the PropertyDetail. |
protected void |
initialize()
Instantiate the object that will allow me to call the setMethods. |
protected boolean |
isCachingDetail()
|
void |
setValues(java.util.Properties props,
java.lang.String categoryId,
java.lang.Object obj)
Set all non null values on the provided object. |
void |
setValues(java.lang.String categoryId,
java.lang.Object obj)
Populate the object with the values found in the property object provided by the PropertyFactory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ReflectiveHelper reflectiveHelper
protected PropertyObjects propertyObjects
Constructor Detail |
public DefaultConfigurationService()
Method Detail |
public void setValues(java.lang.String categoryId, java.lang.Object obj) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
categoryId
- String a '.' delimited path. Like a package name.obj
- The PropertyDetail object that is being populated
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
public void setValues(java.util.Properties props, java.lang.String categoryId, java.lang.Object obj) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
props
- Properties The properties object from which we are looking for
values.categoryId
- String a '.' delimited path. Like a package name.obj
- The PropertyDetail object that is being populated
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
public java.lang.Object getPropertyHolder(PropertySource context) throws ConfigurationException
getPropertyHolder
in interface ConfigurationService
context
- We locate property holder by looking at the PropertySource
ConfigurationException
public java.lang.Object getPropertyHolder(PropertySource context, java.lang.String categoryId) throws ConfigurationException
getPropertyHolder
in interface ConfigurationService
context
- The context we'll use to locate the property values and
PropertyDetailcategoryId
- A dot '.' separated list that will be used to lookup
values in a property object.
ConfigurationException
setValues( java.lang.String, java.lang.Object)
public java.lang.String getCategoryId(PropertySource source)
getCategoryId
in interface ConfigurationService
source
-
protected boolean isCachingDetail()
protected java.lang.Object getOrCreateDetail(PropertySource context, java.lang.String categoryId) throws ConfigurationException
context
- The object that will want this property information.categoryId
- The id that should uniquely identify the desired
properties.
ConfigurationException
protected java.lang.String getPackageName(java.lang.String className)
className
-
public java.lang.String findValueToSet(java.lang.String name, java.util.Properties props, java.lang.String categoryId)
name
- The attribute name.props
- The potential source of the property value.categoryId
- Likely the class name of the PropertySource instance
protected void initialize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |