org.apache.batik.bridge

Class URIResolver

public class URIResolver extends Object

This class is used to resolve the URI that can be found in a SVG document.
Field Summary
protected SVGOMDocumentdocument
The reference document.
protected DocumentLoaderdocumentLoader
The document loader.
protected StringdocumentURI
The document URI.
Constructor Summary
URIResolver(SVGDocument doc, DocumentLoader dl)
Creates a new URI resolver object.
Method Summary
ElementgetElement(String uri, Element ref)
Imports the Element referenced by the given URI on Element ref.
NodegetNode(String uri, Element ref)
Imports the Node referenced by the given URI on Element ref.
protected NodegetNodeByFragment(String frag, Element ref)
Returns the node referenced by the given fragment identifier.
protected StringgetRefererBaseURI(Element ref)
Returns the base URI of the referer element.

Field Detail

document

protected SVGOMDocument document
The reference document.

documentLoader

protected DocumentLoader documentLoader
The document loader.

documentURI

protected String documentURI
The document URI.

Constructor Detail

URIResolver

public URIResolver(SVGDocument doc, DocumentLoader dl)
Creates a new URI resolver object.

Parameters: doc The reference document. dl The document loader.

Method Detail

getElement

public Element getElement(String uri, Element ref)
Imports the Element referenced by the given URI on Element ref.

Parameters: uri The element URI. ref The Element in the DOM tree to evaluate uri from.

Returns: The referenced element or null if element can't be found.

getNode

public Node getNode(String uri, Element ref)
Imports the Node referenced by the given URI on Element ref.

Parameters: uri The element URI. ref The Element in the DOM tree to evaluate uri from.

Returns: The referenced Node/Document or null if element can't be found.

getNodeByFragment

protected Node getNodeByFragment(String frag, Element ref)
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 fragment ref the context element from which to resolve the URI fragment

getRefererBaseURI

protected String getRefererBaseURI(Element ref)
Returns the base URI of the referer element.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.