|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.empire.commons.ErrorObject
org.apache.empire.xml.XMLConfiguration
public class XMLConfiguration
This class manages the configuration of a Java Bean by an xml configuration file. It also supports configuration of Log4J.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.empire.commons.ErrorObject |
---|
ErrorObject.ObjectErrorInfo |
Constructor Summary | |
---|---|
XMLConfiguration()
|
Method Summary | |
---|---|
org.w3c.dom.Element |
getRootNode()
returns the configuration root element or null if init() has not been called. |
boolean |
init(java.lang.String filename,
boolean fromResource)
Initialize the configuration. |
protected boolean |
readConfiguration(java.lang.String fileName,
boolean fromResource)
Reads the configuration file and parses the XML Configuration. |
boolean |
readProperties(java.lang.Object bean,
org.w3c.dom.Element propertiesNode)
reads all properties from a given properties node and applies them to the given bean |
boolean |
readProperties(java.lang.Object bean,
java.lang.String... propertiesNodeNames)
reads all properties from a given properties node and applies them to the given bean |
protected void |
setPropertyValue(java.lang.Object bean,
org.w3c.dom.Node item)
|
Methods inherited from class org.apache.empire.commons.ErrorObject |
---|
clearError, clearErrorInfo, error, error, error, error, error, getErrorInfo, getErrorMessage, getErrorParams, getErrorSource, getErrorType, getMessage, hasError, internalSetError, isExceptionsEnabled, setExceptionsEnabled, success |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLConfiguration()
Method Detail |
---|
public boolean init(java.lang.String filename, boolean fromResource)
filename
- the filefromResource
- will read from the classpath if true
public org.w3c.dom.Element getRootNode()
protected boolean readConfiguration(java.lang.String fileName, boolean fromResource)
public boolean readProperties(java.lang.Object bean, java.lang.String... propertiesNodeNames)
bean
- the bean to which to apply the configurationpropertiesNodeName
- the name of the properties node below the root element
public boolean readProperties(java.lang.Object bean, org.w3c.dom.Element propertiesNode)
bean
- the bean to which to apply the configurationpropertiesNode
- the properties node
protected void setPropertyValue(java.lang.Object bean, org.w3c.dom.Node item)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |