public final class XMLConfig extends Object implements Serializable
The XML is not required to validate a specific schema but will be parsed according to the following rules:
For example, the following XML:
<global>
<myapp test="true" id="123"/>
</global>
Will be read as:
myapp.test=true
myapp.id=123
Note: all property values are internally stored as strings.
Constructor and Description |
---|
XMLConfig()
Creates an empty property list with no default values.
|
XMLConfig(Map<String,String> properties)
Creates an empty property list.
|
Modifier and Type | Method and Description |
---|---|
void |
load(InputStream inStream)
Reads a XML property list from the input stream.
|
static XMLConfig |
newInstance(File file)
Creates a new instance of an XML configuration by loading the specified file.
|
Map<String,String> |
properties()
Returns the properties as a map.
|
public XMLConfig()
public Map<String,String> properties()
The object returned is the actual map instance of this class.
public void load(InputStream inStream) throws IOException
inStream
- The XML input stream to parse.IOException
- If an error occurred when reading from the input stream.public static XMLConfig newInstance(File file) throws IOException
file
- The file to load.IOException
- Should any I/O error occur while reading the file.Copyright © 2016 Allette Systems. All rights reserved.