Class ConfigurationUtil
- java.lang.Object
-
- org.apache.avalon.framework.configuration.ConfigurationUtil
-
public class ConfigurationUtil extends java.lang.Object
This class has a bunch of utility methods to work with configuration objects.- Since:
- 4.1.4
- Version:
- CVS $Revision: 1.18 $ $Date: 2004/05/08 14:05:07 $
- Author:
- Avalon Development Team
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
equals(Configuration c1, Configuration c2)
Test to see if two Configuration's can be considered the same.static Configuration
toConfiguration(org.w3c.dom.Element element)
Convert a DOM Element tree into a configuration tree.static org.w3c.dom.Element
toElement(Configuration configuration)
Convert a configuration tree into a DOM Element tree.static java.lang.String
toString(Configuration configuration)
Serialize the configuration object to a String.
-
-
-
Method Detail
-
toConfiguration
public static Configuration toConfiguration(org.w3c.dom.Element element)
Convert a DOM Element tree into a configuration tree.- Parameters:
element
- the DOM Element- Returns:
- the configuration object
-
toElement
public static org.w3c.dom.Element toElement(Configuration configuration)
Convert a configuration tree into a DOM Element tree.- Parameters:
configuration
- the configuration object- Returns:
- the DOM Element
-
toString
public static java.lang.String toString(Configuration configuration)
Serialize the configuration object to a String. If an exception occurs, the exception message will be returned instead. This method is intended to aid debugging;DefaultConfigurationSerializer.serialize(Configuration)
lets the caller handle exceptions.- Parameters:
configuration
- Configuration instance to serialize- Returns:
- a non-null String representing the
Configuration
, or an error message. - Since:
- 12 March, 2003
-
equals
public static boolean equals(Configuration c1, Configuration c2)
Test to see if two Configuration's can be considered the same. Name, value, attributes and children are test. The order of children is not taken into consideration for equality.- Parameters:
c1
- Configuration to testc2
- Configuration to test- Returns:
- true if the configurations can be considered equals
-
-