Package digilib.util
Class XMLMapLoader
- java.lang.Object
-
- digilib.util.XMLMapLoader
-
public class XMLMapLoader extends Object
Loads a simple XML list into a HashMap. The XML file has an outerlist_tag
. Every entry is anentry_tag
with two attributes: thekey_att
key and thevalue_att
value. The file is read by theloadURL
method, that returns a HashMap with the key-value pairs.- Author:
- casties
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description XMLMapLoader()
XMLMapLoader(String list_tag, String entry_tag, String key_att, String value_att)
Creates an XMLMapLoader with an outerlist_tag
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Map<String,String>
loadUri(URI uri)
load and parse a file (as URL) returns HashMap with list dataMap<String,String>
loadURL(String uri)
Deprecated.UseloadUri(URI)
instead
-
-
-
Constructor Detail
-
XMLMapLoader
public XMLMapLoader()
-
XMLMapLoader
public XMLMapLoader(String list_tag, String entry_tag, String key_att, String value_att)
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 Detail
-
loadURL
public Map<String,String> loadURL(String uri) throws SAXException, IOException
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
public Map<String,String> loadUri(URI uri) throws SAXException, IOException
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
-
-