Qizx/open API

net.axyana.qizxopen.dm
Class DocumentManager

java.lang.Object
  extended bynet.axyana.qizxopen.dm.DocumentParser
      extended bynet.axyana.qizxopen.dm.DocumentManager

public class DocumentManager
extends DocumentParser

Provides access to the data-model of XML documents.

Resolves the URI of a document and parses it or opens it according to its representation.

Parsed documents are managed in a cache with configurable size (see setCacheSize(long)).

Supports XML catalogs through Norman Walsh's com.sun.resolver.tools.CatalogResolver.


Field Summary
 
Fields inherited from class net.axyana.qizxopen.dm.DocumentParser
RESOLVER_CLASS, RESOLVER_CLASS_PROP
 
Constructor Summary
DocumentManager(java.lang.String baseURI)
          Creation with a single base location.
DocumentManager(java.net.URL baseURL)
          Creation with a single base location.
 
Method Summary
 FONIDocument findDocument(java.lang.String uri)
          Cached access by URI.
 Node findDocumentNode(java.lang.String uri)
          Cached access by URI.
 java.net.URL getBaseURL()
          Returns the current base URL.
 void setBaseURL(java.net.URL baseURL)
           
 void setCacheSize(long size)
          Defines the maximal memory size of the document cache.
 
Methods inherited from class net.axyana.qizxopen.dm.DocumentParser
newParser, parse, parseDocument, parseDocument, parseDocument, parseDocument
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentManager

public DocumentManager(java.net.URL baseURL)
Creation with a single base location.

Parameters:
baseURL - the base URL used for resolving a relative document URI. For parsed documents, any Java-supported URL is suitable.

DocumentManager

public DocumentManager(java.lang.String baseURI)
                throws java.io.IOException
Creation with a single base location.

Method Detail

setCacheSize

public void setCacheSize(long size)
Defines the maximal memory size of the document cache. This size is otherwise defined by the system property "net.axyana.qizxopen.docman.cachesize".

Parameters:
size - in bytes (hint).

getBaseURL

public java.net.URL getBaseURL()
Returns the current base URL.


setBaseURL

public void setBaseURL(java.net.URL baseURL)

findDocumentNode

public Node findDocumentNode(java.lang.String uri)
                      throws DataModelException
Cached access by URI.

Returns:
the root node (or document node) of the document.
Throws:
DataModelException

findDocument

public FONIDocument findDocument(java.lang.String uri)
                          throws DataModelException
Cached access by URI.

Throws:
DataModelException

© 2005 Axyana Software