Package org.apache.batik.bridge
Class URIResolver
java.lang.Object
org.apache.batik.bridge.URIResolver
- Direct Known Subclasses:
SVG12URIResolver
This class is used to resolve the URI that can be found in a SVG document.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SVGOMDocument
The reference document.protected DocumentLoader
The document loader.protected String
The document URI. -
Constructor Summary
ConstructorsConstructorDescriptionURIResolver
(org.w3c.dom.svg.SVGDocument doc, DocumentLoader dl) Creates a new URI resolver object. -
Method Summary
Modifier and TypeMethodDescriptiongetElement
(String uri, Element ref) Imports the Element referenced by the given URI on Elementref
.Imports the Node referenced by the given URI on Elementref
.protected Node
getNodeByFragment
(String frag, Element ref) Returns the node referenced by the given fragment identifier.protected String
getRefererBaseURI
(Element ref) Returns the base URI of the referer element.
-
Field Details
-
document
The reference document. -
documentURI
The document URI. -
documentLoader
The document loader.
-
-
Constructor Details
-
URIResolver
Creates a new URI resolver object.- Parameters:
doc
- The reference document.dl
- The document loader.
-
-
Method Details
-
getElement
Imports the Element referenced by the given URI on Elementref
.- Parameters:
uri
- The element URI.ref
- The Element in the DOM tree to evaluateuri
from.- Returns:
- The referenced element or null if element can't be found.
- Throws:
MalformedURLException
IOException
-
getNode
public Node getNode(String uri, Element ref) throws MalformedURLException, IOException, SecurityException Imports the Node referenced by the given URI on Elementref
.- Parameters:
uri
- The element URI.ref
- The Element in the DOM tree to evaluateuri
from.- Returns:
- The referenced Node/Document or null if element can't be found.
- Throws:
MalformedURLException
IOException
SecurityException
-
getRefererBaseURI
Returns the base URI of the referer element. -
getNodeByFragment
Returns the node referenced by the given fragment identifier. This is called when the whole URI just contains a fragment identifier and there is no XML Base URI in effect.- Parameters:
frag
- the URI fragmentref
- the context element from which to resolve the URI fragment
-