java.lang.Object
java.util.AbstractMap
java.util.HashMap
java.util.LinkedHashMap
org.greenstone.gatherer.msm.GDMParser
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Map, java.io.Serializable
- public class GDMParser
- extends java.util.LinkedHashMap
Parses metadata.xml documents of the GreenstoneDirectoryMetadata variety, caching where possible.
| Nested classes inherited from class java.util.HashMap |
|
| Nested classes inherited from class java.util.AbstractMap |
|
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
|
Field Summary |
private java.util.ArrayList |
ignore
A list of file names that we know do not actually belong to valid GDM xml files, so there not much point in ever trying to read them again. |
private int |
max_size
The default maximum cache size if max size not explicitly set. |
private org.apache.xerces.parsers.DOMParser |
parser
The actual xerces parser used to read in xml documents. |
| Fields inherited from class java.util.HashMap |
|
|
Constructor Summary |
GDMParser()
Default constructor. |
GDMParser(int max_size)
Constructor with maximum size set. |
|
Method Summary |
void |
destroy()
Destructor, clears cache and remove persistant global references. |
org.w3c.dom.Document |
parse(java.io.File file)
Fetches the document for the given xml file. |
protected boolean |
removeEldestEntry(java.util.Map.Entry eldest)
Automatically called by the LinkedHashMap object whenever an object is added, to determine whether it should remove the oldest entry. |
ignore
private java.util.ArrayList ignore
- A list of file names that we know do not actually belong to valid GDM xml files, so there not much point in ever trying to read them again.
parser
private org.apache.xerces.parsers.DOMParser parser
- The actual xerces parser used to read in xml documents.
max_size
private int max_size
- The default maximum cache size if max size not explicitly set.
GDMParser
public GDMParser()
- Default constructor.
GDMParser
public GDMParser(int max_size)
- Constructor with maximum size set.
destroy
public void destroy()
- Destructor, clears cache and remove persistant global references.
parse
public org.w3c.dom.Document parse(java.io.File file)
- Fetches the document for the given xml file. This may mean (re)parsing it or simply fetching it from cache.
removeEldestEntry
protected boolean removeEldestEntry(java.util.Map.Entry eldest)
- Automatically called by the LinkedHashMap object whenever an object is added, to determine whether it should remove the oldest entry.