Class DocumentLoader
java.lang.Object
org.apache.batik.bridge.DocumentLoader
This class is responsible on loading an SVG document and
maintaining a cache.
- Version:
- $Id$
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classA simple class that contains a Document and its number of nodes. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HashMapThe map that contains the Document indexed by the URI.protected SVGDocumentFactoryThe document factory used to create the document according a DOM implementation.protected UserAgentThe user agent. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs a newDocumentLoader.DocumentLoader(UserAgent userAgent) Constructs a newDocumentLoaderwith the specified XML parser. -
Method Summary
Modifier and TypeMethodDescriptioncheckCache(String uri) voiddispose()Disposes and releases all resources allocated by this document loader.intReturns the line in the source code of the specified element or -1 if not found.Returns the userAgent used by this DocumentLoaderloadDocument(String uri) Returns a document from the specified uri.loadDocument(String uri, InputStream is) Returns a document from the specified uri.
-
Field Details
-
documentFactory
The document factory used to create the document according a DOM implementation. -
cacheMap
The map that contains the Document indexed by the URI. WARNING: tagged private as no element of this Map should be referenced outise of this class -
userAgent
The user agent.
-
-
Constructor Details
-
DocumentLoader
protected DocumentLoader()Constructs a newDocumentLoader. -
DocumentLoader
Constructs a newDocumentLoaderwith the specified XML parser.- Parameters:
userAgent- the user agent to use
-
-
Method Details
-
checkCache
-
loadDocument
Returns a document from the specified uri.- Parameters:
uri- the uri of the document- Throws:
IOException- if an I/O error occured while loading the document
-
loadDocument
Returns a document from the specified uri.- Parameters:
uri- the uri of the document- Throws:
IOException- if an I/O error occured while loading the document
-
getUserAgent
Returns the userAgent used by this DocumentLoader -
dispose
public void dispose()Disposes and releases all resources allocated by this document loader. -
getLineNumber
Returns the line in the source code of the specified element or -1 if not found.- Parameters:
e- the element- Returns:
- -1 the document has been removed from the cache or has not been loaded by this document loader.
-