Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.greenstone.gatherer.msm
Class GDMParser  view GDMParser download GDMParser.java

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byjava.util.LinkedHashMap
              extended byorg.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 Class Summary
 
Nested classes inherited from class java.util.LinkedHashMap
 
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.LinkedHashMap
 
Fields inherited from class java.util.HashMap
 
Fields inherited from class java.util.AbstractMap
 
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.
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get
 
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

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.

Constructor Detail

GDMParser

public GDMParser()
Default constructor.


GDMParser

public GDMParser(int max_size)
Constructor with maximum size set.

Method Detail

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.