|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.objectwave.configuration.xml.XmlConfigurationService
To use XML to configure your application, use this class as the default
configuration service.
To use simply do the following
ConfigurationService srvc = new XmlConfigurationService(); ConfigurationServiceFactory.setDefaultConfigurationService( srvc );
| Nested Class Summary | |
static class |
XmlConfigurationService.Test
|
| Field Summary | |
protected PropertyObjects |
propertyObjects
|
| Constructor Summary | |
XmlConfigurationService()
Constructor for the XmlConfigurationService object |
|
| Method Summary | |
void |
addSupport(java.lang.String path,
java.lang.String className)
|
java.lang.String |
getCategoryId(PropertySource source)
Categories are identified by the full name of the property source. |
protected java.lang.String |
getDefaultKey(PropertySource context)
Gets the default key. |
protected java.lang.Object |
getDetail(PropertySource context,
java.lang.String categoryId)
Find the existing detail object. |
java.lang.Object |
getPropertyHolder(PropertySource context)
Create and return an instance of the PropertyDetail. |
java.lang.Object |
getPropertyHolder(PropertySource context,
java.lang.String categoryId)
For the provided property source and category, locate & populate the PropertyDetail. |
protected java.lang.Object |
getPropertyHolderFromParser(PropertySource context,
java.lang.String categoryId,
javax.xml.parsers.SAXParser saxParser)
Locate the XML document for the context and category, parse it, and set values on a new PropertyDetail. |
protected org.xml.sax.InputSource |
getXmlInputSource(PropertySource context,
java.lang.String categoryId)
Use an instance of XmlBootstrap to locate an XML document for the specified context and category. |
protected java.util.HashMap |
initDefaultStrategy(PropertySource context)
This allows users of the configuration service to not specify Xml path to class mappings. |
void |
initialize()
A unique cache of details per Configuration service instance. |
protected static void |
initializeSaxParser()
|
protected boolean |
isCachingDetail()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected PropertyObjects propertyObjects
| Constructor Detail |
public XmlConfigurationService()
| Method Detail |
protected static void initializeSaxParser()
public java.lang.String getCategoryId(PropertySource source)
getCategoryId in interface ConfigurationServicesource -
public java.lang.Object getPropertyHolder(PropertySource context)
throws ConfigurationException
getPropertyHolder in interface ConfigurationServicecontext - The PropertySource attempting to locate the property detail.
ConfigurationException
public java.lang.Object getPropertyHolder(PropertySource context,
java.lang.String categoryId)
throws ConfigurationException
getPropertyHolder in interface ConfigurationServicecontext - The PropertySource attempting to locate the property detail.categoryId - Likely the full class name of the property source.
ConfigurationException
protected java.lang.Object getDetail(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.Object getPropertyHolderFromParser(PropertySource context,
java.lang.String categoryId,
javax.xml.parsers.SAXParser saxParser)
throws java.lang.Exception
context - categoryId - saxParser -
java.lang.Exception - There are MANY ways we can failprotected java.lang.String getDefaultKey(PropertySource context)
context -
protected org.xml.sax.InputSource getXmlInputSource(PropertySource context,
java.lang.String categoryId)
throws java.lang.Exception
context - The Object looking for a PropertyDetails.categoryId - Likely the full class name of the context.getExpectedClass
java.lang.ExceptionXmlBootstrap.locateXmlMap(com.objectwave.configuration.PropertySource, java.lang.String)protected boolean isCachingDetail()
public void initialize()
public void addSupport(java.lang.String path,
java.lang.String className)
path - The XML nodes that should translate to a Java classclassName - The class to instantiate for each XML node of type pathprotected java.util.HashMap initDefaultStrategy(PropertySource context)
context - The source attempting to locate property detail.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||