|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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.
Constructor Summary | |
---|---|
XMLConfiguration()
|
Method Summary | |
---|---|
Element |
getRootNode()
returns the configuration root element or null if init() has not been called. |
void |
init(String filename,
boolean fromResource)
Initialize the configuration. |
protected void |
readConfiguration(String fileName,
boolean fromResource)
Reads the configuration file and parses the XML Configuration. |
void |
readProperties(Object bean,
Element propertiesNode)
reads all properties from a given properties node and applies them to the given bean |
void |
readProperties(Object bean,
String... propertiesNodeNames)
reads all properties from a given properties node and applies them to the given bean |
protected void |
setPropertyValue(Object bean,
Node item)
|
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 void init(String filename, boolean fromResource)
filename
- the filefromResource
- will read from the classpath if truepublic Element getRootNode()
protected void readConfiguration(String fileName, boolean fromResource)
public void readProperties(Object bean, String... propertiesNodeNames)
bean
- the bean to which to apply the configurationpropertiesNodeNames
- the name of the properties node below the root elementpublic void readProperties(Object bean, Element propertiesNode)
bean
- the bean to which to apply the configurationpropertiesNode
- the properties nodeprotected void setPropertyValue(Object bean, Node item)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |