edu.ucsb.nceas.morpho.query
Class LocalQuery
java.lang.Object
|
+--edu.ucsb.nceas.morpho.query.LocalQuery
- public class LocalQuery
- extends java.lang.Object
LocalQuery is a class designed to execute a query defined in
an XML document that follows the PathQuery DTD. The path based
query statements are converted to XPath expressions and the
XPath API features of Apache Xalan/Xerces are used to find
nodes specified by the expressions. All XML documents in a given
local subdirectory are scanned. The process thus mimics the database
search on Metacat, but is applied only to local documents.
Field Summary |
static java.util.Hashtable |
dom_collection
hash table with dom objects from previously scanned local XML
documents; serves as a cache to avoid having to re-parse documents
every time an XPath search is carried out. |
Method Summary |
ResultSet |
execute()
Run the query against the local document store |
static void |
main(java.lang.String[] args)
Main routine for testing |
static void |
removeFromCache(java.lang.String docid)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
dom_collection
public static java.util.Hashtable dom_collection
- hash table with dom objects from previously scanned local XML
documents; serves as a cache to avoid having to re-parse documents
every time an XPath search is carried out. key is filename which should
match document id.
LocalQuery
public LocalQuery(Query query,
Morpho morpho)
- Basic Constuctor for the class
- Parameters:
query
- the query on which this Local query is basedmorpho
- the Morpho framework
execute
public ResultSet execute()
- Run the query against the local document store
removeFromCache
public static void removeFromCache(java.lang.String docid)
main
public static void main(java.lang.String[] args)
- Main routine for testing
Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.