Configures 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.
The actual XML file format may be changed (eg to spring XML) by implementing the
ConfigurationProcessorFactory interface to be found by the
ServiceLoader by using the DTD and first tag element in the file.
Note that DTD will be null if validation is off.
The configuration can be parameterised with properties that are looked up via the
Property XML element and set on the configuration via the map returned from
getProperties()
The configuration can create and lookup beans by ID. If multiple configurations are used, then it
is good practise to copy the entries from the getIdMap() of a configuration to the next
configuration so that they can share an ID space for beans.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final Pool | |
| private final String | |
| private final Map | |
| private final Resource | |
| private ConfigurationProcessor | |
| private final Map | |
| private static final Class | |
| public static final Comparator | |
| private static final Logger | |
| private static final Class | |
| private static final List | |
| private static final Class |
| Access | Constructor and Description |
|---|---|
| public | XmlConfiguration(Resource
the Resource to the XML configuration resource)Reads and parses the XML configuration file. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static int | |
| public Object | |
| public Object | |
| public Map | Returns: A modifiable map of ID strings to ObjectsGet the map of ID String to Objects that is used to hold and lookup any objects by ID. A New, Get or Call XML element may have an id attribute which will cause the resulting object to be placed into this map. |
| private static List | |
| public Map | Returns: A modifiable map of properties.Get the map of properties used by the Property XML element to parametrize configuration. |
| public XmlParser | |
| public void | initializeDefaults(Object
the object to initialize defaults on object)Initialize a new Object defaults. |
| public static void | |
| public static String | |
| public static String | Returns: String to resolved and normalized path, or null if dir or destPath is empty.the directory (should be a directory reference, does not have to exist) dir, String the destination path (can be relative or absolute, syntax depends on OS + FileSystem in use,
and does not need to exist) destPath)Utility method to resolve a provided path against a directory. |
| private void | |
| public void | setJettyStandardIdsAndProperties(Object
The Server object to set server, Path The webapps Resource webapp)Set the standard IDs and properties expected in a jetty XML file:
|
| public String |