|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mortbay.xml.XmlConfiguration
public class XmlConfiguration
Configure Objects from XML. This class reads an XML file conforming to the configure.dtd DTD and uses it to configure and object by calling set, put or other methods on the object.
Field Summary | |
---|---|
private static XmlParser |
__parser
|
private static Class[] |
__primitiveHolders
|
private static Class[] |
__primitives
|
private XmlParser.Node |
_config
|
private Map |
_idMap
|
Constructor Summary | |
---|---|
XmlConfiguration(InputStream configuration)
Constructor. |
|
XmlConfiguration(String configuration)
Constructor. |
|
XmlConfiguration(URL configuration)
Constructor. |
Method Summary | |
---|---|
private Object |
call(Object obj,
XmlParser.Node node)
|
void |
configure(Object obj)
Configure an object. |
private void |
configure(Object obj,
XmlParser.Node cfg,
int i)
|
private Object |
get(Object obj,
XmlParser.Node node)
|
private static void |
initParser()
|
private Object |
itemValue(Object obj,
Object item)
|
static void |
main(String[] args)
|
private Object |
newArray(Object obj,
XmlParser.Node node)
|
Object |
newInstance()
Create a new object and configure it. |
private Object |
newMap(Object obj,
XmlParser.Node node)
|
private Object |
newObj(Object obj,
XmlParser.Node node)
|
private Class |
nodeClass(XmlParser.Node node)
|
private void |
put(Object obj,
XmlParser.Node node)
|
private Object |
refObj(Object obj,
XmlParser.Node node)
|
private void |
set(Object obj,
XmlParser.Node node)
|
private Object |
value(Object obj,
XmlParser.Node node)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static Class[] __primitives
private static Class[] __primitiveHolders
private static XmlParser __parser
private XmlParser.Node _config
private Map _idMap
Constructor Detail |
---|
public XmlConfiguration(URL configuration) throws SAXException, IOException
configuration
-
SAXException
IOException
public XmlConfiguration(String configuration) throws SAXException, IOException
configuration
- String of XML configuration commands excluding the normal XML preamble.
The String should start with a " SAXException
IOException
public XmlConfiguration(InputStream configuration) throws SAXException, IOException
configuration
- An input stream containing a complete e.g. configuration file
SAXException
IOException
Method Detail |
---|
private static void initParser() throws IOException
IOException
public void configure(Object obj) throws Exception
obj
- The object to be configured.
Exception
public Object newInstance() throws Exception
Exception
private Class nodeClass(XmlParser.Node node) throws ClassNotFoundException
ClassNotFoundException
private void configure(Object obj, XmlParser.Node cfg, int i) throws Exception
Exception
private void set(Object obj, XmlParser.Node node) throws Exception
Exception
private void put(Object obj, XmlParser.Node node) throws Exception
Exception
private Object get(Object obj, XmlParser.Node node) throws Exception
Exception
private Object call(Object obj, XmlParser.Node node) throws Exception
Exception
private Object newObj(Object obj, XmlParser.Node node) throws Exception
Exception
private Object refObj(Object obj, XmlParser.Node node) throws Exception
Exception
private Object newArray(Object obj, XmlParser.Node node) throws Exception
Exception
private Object newMap(Object obj, XmlParser.Node node) throws Exception
Exception
private Object value(Object obj, XmlParser.Node node) throws Exception
Exception
private Object itemValue(Object obj, Object item) throws Exception
Exception
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |