org.exolab.adaptx.xml
Class SAXURILocation

java.lang.Object
  extended by org.exolab.adaptx.net.URILocation
      extended by org.exolab.adaptx.net.ObjectURILocation
          extended by org.exolab.adaptx.xml.SAXURILocation

public final class SAXURILocation
extends ObjectURILocation

An implementation of ObjectURILocation for a SAX XMLReader

Author:
Keith Visco

Constructor Summary
SAXURILocation(org.xml.sax.XMLReader reader, org.xml.sax.InputSource source)
          Creates a new SAXURILocation
 
Method Summary
 java.lang.String getAbsoluteURI()
          Returns the absolute URI for this URILocation
 java.lang.String getBaseURI()
          Returns the base location of this URILocation.
 org.xml.sax.InputSource getInputSource()
          Returns the InputSource for this SAXURILocation
 java.lang.Object getObject()
          Returns the Object from this ObjectURILocation.
 java.io.Reader getReader()
          Returns the reader for this URILocation.
 java.lang.String getRelativeURI()
          Returns the relative URI for this URILocation
 org.xml.sax.XMLReader getXMLReader()
          Returns the SAX XMLReader for this URILocation, or null if not set.
 java.lang.String toString()
          Returns the String representation of this URILocation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SAXURILocation

public SAXURILocation(org.xml.sax.XMLReader reader,
                      org.xml.sax.InputSource source)
Creates a new SAXURILocation

Method Detail

getAbsoluteURI

public java.lang.String getAbsoluteURI()
Returns the absolute URI for this URILocation

Specified by:
getAbsoluteURI in class URILocation
Returns:
the absolute URI for this URILocation
See Also:
getRelativeURI, getBaseURI

getBaseURI

public java.lang.String getBaseURI()
Returns the base location of this URILocation. If this URILocation is an URL, the base location will be equivalent to the document base for the URL.

Specified by:
getBaseURI in class URILocation
Returns:
the base location of this URILocation
See Also:
getAbsoluteURI, getRelativeURI

getXMLReader

public org.xml.sax.XMLReader getXMLReader()
Returns the SAX XMLReader for this URILocation, or null if not set.

Returns:
the SAX XMLReader for this URILocation

getInputSource

public org.xml.sax.InputSource getInputSource()
Returns the InputSource for this SAXURILocation

Returns:
the InputSource

getObject

public java.lang.Object getObject()
Returns the Object from this ObjectURILocation.

This method will return the XMLReader

Specified by:
getObject in class ObjectURILocation
Returns:
the Object from this ObjectURILocation
See Also:
getXMLReader()

getReader

public java.io.Reader getReader()
                         throws java.io.IOException
Returns the reader for this URILocation.

This method may return null, if an XMLReader exists. Try getXMLReader first.

Specified by:
getReader in class URILocation
Returns:
a Reader for the resource represented by this URILocation
Throws:
java.io.FileNotFoundException
java.io.IOException

getRelativeURI

public java.lang.String getRelativeURI()
Returns the relative URI for this URILocation

Specified by:
getRelativeURI in class URILocation
Returns:
the relative URI for this URILocation
See Also:
getAbsoluteURI, getBaseURI

toString

public java.lang.String toString()
Returns the String representation of this URILocation.

Overrides:
toString in class URILocation
Returns:
the String representation of this URILocation