public class DocumentLoader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap |
cacheMap
The map that contains the Document indexed by the URI.
|
protected SVGDocumentFactory |
documentFactory
The document factory used to create the document according a
DOM implementation.
|
protected UserAgent |
userAgent
The user agent.
|
Modifier | Constructor and Description |
---|---|
protected |
DocumentLoader()
Constructs a new
DocumentLoader . |
|
DocumentLoader(UserAgent userAgent)
Constructs a new
DocumentLoader with the specified XML parser. |
Modifier and Type | Method and Description |
---|---|
Document |
checkCache(java.lang.String uri) |
void |
dispose()
Disposes and releases all resources allocated by this document loader.
|
int |
getLineNumber(Element e)
Returns the line in the source code of the specified element or
-1 if not found.
|
UserAgent |
getUserAgent()
Returns the userAgent used by this DocumentLoader
|
Document |
loadDocument(java.lang.String uri)
Returns a document from the specified uri.
|
Document |
loadDocument(java.lang.String uri,
java.io.InputStream is)
Returns a document from the specified uri.
|
protected SVGDocumentFactory documentFactory
protected java.util.HashMap cacheMap
protected UserAgent userAgent
protected DocumentLoader()
DocumentLoader
.public DocumentLoader(UserAgent userAgent)
DocumentLoader
with the specified XML parser.userAgent
- the user agent to usepublic Document checkCache(java.lang.String uri)
public Document loadDocument(java.lang.String uri) throws java.io.IOException
uri
- the uri of the documentjava.io.IOException
- if an I/O error occured while loading
the documentpublic Document loadDocument(java.lang.String uri, java.io.InputStream is) throws java.io.IOException
uri
- the uri of the documentjava.io.IOException
- if an I/O error occured while loading
the documentpublic UserAgent getUserAgent()
public void dispose()
public int getLineNumber(Element e)
e
- the elementCopyright © 2022 Apache Software Foundation. All Rights Reserved.