Package digilib.util
Class XMLMapLoader
java.lang.Object
digilib.util.XMLMapLoader
Loads a simple XML list into a HashMap.
The XML file has an outer
list_tag
. Every entry is an
entry_tag
with two attributes: the key_att
key and the value_att
value.
The file is read by the loadURL
method, that returns a
HashMap with the key-value pairs.- Author:
- casties
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionXMLMapLoader
(String list_tag, String entry_tag, String key_att, String value_att) Creates an XMLMapLoader with an outerlist_tag
. -
Method Summary
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
XMLMapLoader
public XMLMapLoader() -
XMLMapLoader
Creates an XMLMapLoader with an outerlist_tag
. Every entry is anentry_tag
with two attributes: thekey_att
key and thevalue_att
value.- Parameters:
list_tag
- the list tagentry_tag
- the entry tagkey_att
- the key attributevalue_att
- the value attribute
-
-
Method Details
-
loadURL
Deprecated.UseloadUri(URI)
insteadload and parse a file (as URL) returns HashMap with list data- Parameters:
uri
- the URI- Returns:
- the Map
- Throws:
SAXException
- on errorIOException
- on error
-
loadUri
load and parse a file (as URL) returns HashMap with list data- Parameters:
uri
- the URI- Returns:
- the Map
- Throws:
SAXException
- on errorIOException
- on error
-
loadUri(URI)
instead