## org.mortbay.xml
Class XmlConfiguration

    java.lang.Object
      |
      +--org.mortbay.xml.XmlConfiguration

public class XmlConfiguration
extends java.lang.Object

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.

Version:
  $Id: XmlConfiguration.java,v 1.11 2003/07/03 07:12:54 gregwilkins Exp $
Author:
  Greg Wilkins (gregw)

Constructor Summary
`XmlConfiguration(java.lang.String configuration)` Constructor.
`XmlConfiguration(java.net.URL configuration)` Constructor.

Method Summary
`void` `configure(java.lang.Object obj)` Configure an object.
`static void` `main(java.lang.String[] arg)`
`java.lang.Object` `newInstance()` Create a new object and configure it.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### XmlConfiguration

    public XmlConfiguration(java.net.URL configuration)
                     throws org.xml.sax.SAXException,
                            java.io.IOException

  Constructor. Reads the XML configuration file.

Parameters:
  `configuration` -

### XmlConfiguration

    public XmlConfiguration(java.lang.String configuration)
                     throws org.xml.sax.SAXException,
                            java.io.IOException

  Constructor.

Parameters:
  `configuration` - String of XML configuration commands excluding the normal XML preamble. The String should start with a "<Configure ...." element. <DT>Throws:
  `org.xml.sax.SAXException`
  `java.io.IOException`

Method Detail

### configure

    public void configure(java.lang.Object obj)
                   throws java.lang.ClassNotFoundException,
                          java.lang.NoSuchMethodException,
                          java.lang.reflect.InvocationTargetException,
                          java.lang.IllegalAccessException

  Configure an object. If the object is of the approprate class, the XML configuration script is applied to the object.

  Parameters:
    `obj` - The object to be configured.
  Throws:
    `java.lang.ClassNotFoundException`
    `java.lang.NoSuchMethodException`
    `java.lang.reflect.InvocationTargetException`
    `java.lang.IllegalAccessException`

### newInstance

    public java.lang.Object newInstance()
                                 throws java.lang.ClassNotFoundException,
                                        java.lang.NoSuchMethodException,
                                        java.lang.reflect.InvocationTargetException,
                                        java.lang.InstantiationException,
                                        java.lang.IllegalAccessException

  Create a new object and configure it. A new object is created and configured.

  Returns:
    The newly created configured object.
  Throws:
    `java.lang.ClassNotFoundException`
    `java.lang.NoSuchMethodException`
    `java.lang.reflect.InvocationTargetException`
    `java.lang.InstantiationException`
    `java.lang.IllegalAccessException`

### main

    public static void main(java.lang.String[] arg)

Copyright © 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.