Package digilib.util
Class XMLMapListLoader
- java.lang.Object
-
- digilib.util.XMLMapListLoader
-
public class XMLMapListLoader extends Object
Loads a simple XML structure into a List of Maps. The XML file has an outerlist_tag
. Every entry is anentry_tag
. All attributes are loaded into a Map. Nested tags are not supported. The text content of the tag is put in the Map under the key "_text". The file is read by theloadURI()
method, that returns a List with Maps of key-value pairs.- Author:
- casties
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONTENT_KEY
protected static org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description XMLMapListLoader()
XMLMapListLoader(String list_tag, String entry_tag)
Creates an XMLMapListLoader with an outerlist_tag
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Map<String,String>>
loadUri(URI uri)
Load and parse a file (as URL).
-
-
-
Field Detail
-
logger
protected static final org.slf4j.Logger logger
-
CONTENT_KEY
public static String CONTENT_KEY
-
-
Method Detail
-
loadUri
public List<Map<String,String>> loadUri(URI uri) throws SAXException, IOException
Load and parse a file (as URL). returns List of Maps with data.- Parameters:
uri
- the URI- Returns:
- the Map
- Throws:
SAXException
- on errorIOException
- on error
-
-