
public class DOMConfigurator extends Object
| Constructor and Description |
|---|
DOMConfigurator(Settings4jRepository repository)
Configure the given Settings4jRepository with an XMl-configuration (see settings4j.dtd).
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExpressionAttribute(String key,
Object value)
Add a ExpressionAttribute like ('ContextPath', 'myApp').
|
static void |
configure(URL url,
Settings4jRepository repository)
A static version of
doConfigure(URL). |
void |
doConfigure(URL url) |
protected Connector |
findConnectorByName(Document doc,
String connectorName)
Used internally to parse connectors by IDREF name.
|
protected Connector |
findConnectorByReference(Element connectorRef)
Used internally to parse connectors by IDREF element.
|
protected ContentResolver |
findContentResolverByName(Document doc,
String contentResolverName)
Used internally to parse contentResolvers by IDREF name.
|
protected ContentResolver |
findContentResolverByReference(Element contentResolverRef)
Used internally to parse contentResolvers by IDREF element.
|
protected ObjectResolver |
findObjectResolverByName(Document doc,
String objectResolverName)
Used internally to parse objectResolvers by IDREF name.
|
protected ObjectResolver |
findObjectResolverByReference(Element objectResolverRef)
Used internally to parse objectResolvers by IDREF element.
|
protected Connector[] |
getConnectors(Element connectorsElement)
Return all referenced connectors from Child-Nodes
CONNECTOR_REF_TAG. |
protected void |
parse(Element element)
Used internally to configure the settings4j framework by parsing a DOM tree of XML elements based on settings4j.dtd.
|
protected void |
parseChildrenOfSettingsElement(Element settingsElement,
Settings4jInstance settings)
Used internally to parse the children of a settings element.
|
protected Connector |
parseConnector(Element connectorElement)
Used internally to parse an connector element.
|
protected ContentResolver |
parseContentResolver(Element contentResolverElement)
Used internally to parse an contentResolver element.
|
protected Filter |
parseFilter(Element filterElement)
Used internally to parse an Filter element.
|
protected Map |
parseMapping(Element mappingElement)
Used internally to parse an mapping element.
|
protected ObjectResolver |
parseObjectResolver(Element objectResolverElement)
Used internally to parse an objectResolver element.
|
protected String |
subst(String value,
Connector[] connectors)
This function will replace expressions like ${connectors.string['']}.
|
protected Object |
subst(String value,
Connector[] connectors,
Class clazz)
This function will replace expressions like ${connectors.object['']} or simply ${true}.
|
public DOMConfigurator(Settings4jRepository repository)
repository - The Repository to configure.public static void configure(URL url, Settings4jRepository repository) throws FactoryConfigurationError
doConfigure(URL).url - The location of the configuration file.repository - the Repository to configure.FactoryConfigurationError - if DocumentBuilderFactory.newInstance() throws an exception.public void doConfigure(URL url)
url - The location of the configuration file.protected void parse(Element element)
element - The XML CONFIGURATION_TAG Element.protected Filter parseFilter(Element filterElement)
filterElement - the XML-Element for Filter.protected Connector parseConnector(Element connectorElement)
connectorElement - The XML Connector Elementprotected Connector[] getConnectors(Element connectorsElement)
CONNECTOR_REF_TAG.connectorsElement - The XML Connectors Elementprotected void parseChildrenOfSettingsElement(Element settingsElement, Settings4jInstance settings)
settingsElement - The XML Settings Elementsettings - _The Settings Object do apply the values.protected Connector findConnectorByName(Document doc, String connectorName)
doc - The whole XML configuration.connectorName - The Connector-Name, to search for.protected Connector findConnectorByReference(Element connectorRef)
connectorRef - The Element with the REF_ATTR - Attribute.protected ObjectResolver parseObjectResolver(Element objectResolverElement)
objectResolverElement - The XML Object resolver Element.protected Map parseMapping(Element mappingElement)
mappingElement - The XML Mapping Element.protected ContentResolver parseContentResolver(Element contentResolverElement)
contentResolverElement - The ContentResolver Element.protected ContentResolver findContentResolverByName(Document doc, String contentResolverName)
doc - XML Document of the whole settings4j.xml.contentResolverName - the contentResolver Name to search for.protected ObjectResolver findObjectResolverByName(Document doc, String objectResolverName)
doc - XML Document of the whole settings4j.xml.objectResolverName - the ObjectResolver Name to search for.protected ObjectResolver findObjectResolverByReference(Element objectResolverRef)
objectResolverRef - The Element with the REF_ATTR.protected ContentResolver findContentResolverByReference(Element contentResolverRef)
contentResolverRef - The Element with the REF_ATTR.protected String subst(String value, Connector[] connectors)
value - The value or Expression.connectors - required for validating Expression like ${connectors.string['']}protected Object subst(String value, Connector[] connectors, Class clazz)
value - The value or Expression.clazz - The expected Class.connectors - required for validating Expression like ${connectors.string['']}public void addExpressionAttribute(String key, Object value)
A settings4j.xml Value like value="c:/settings/${contextPath}" will be evaluated as "c:/settings/myApp".
key - The Key as String.value - The value as Object.Copyright © 2008–2014. All rights reserved.