org.enhydra.zeus.source
Class BaseSource

java.lang.Object
  |
  +--org.enhydra.zeus.source.BaseSource
All Implemented Interfaces:
Source
Direct Known Subclasses:
DTDSource, StreamSource

public abstract class BaseSource
extends java.lang.Object
implements Source

Source provides an interface for all input means. It details the required contract that other portions of the Zeus XML data binding framework must use for processing of an arbitrary input.

This implementation of Source handles the basic functionality of dealing with system IDs so that other implementations don't have to code these methods. Thus, XXXSource classes should extend this class, rather than directly implementing Source, and will get this functionality "for free."

Version:
1.0
Author:
Brett McLaughlin

Field Summary
protected  org.xml.sax.EntityResolver entityResolver
          EntityResolver to pass to parser
protected  java.lang.String systemID
          The system ID for this Source
 
Constructor Summary
BaseSource()
           
 
Method Summary
abstract  org.jdom.Document getDocument()
           This will return a JDOM Document that represents the input source.
 java.lang.String getSystemID()
           This will return the system ID associated with this Source.
 void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
           This will set an EntityResolver for this Source.
 void setSystemID(java.lang.String systemID)
           This will set the system ID for this Source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

systemID

protected java.lang.String systemID
The system ID for this Source

entityResolver

protected org.xml.sax.EntityResolver entityResolver
EntityResolver to pass to parser
Constructor Detail

BaseSource

public BaseSource()
Method Detail

getSystemID

public java.lang.String getSystemID()

This will return the system ID associated with this Source. This is generally in the form of a URI.

Specified by:
getSystemID in interface Source
Returns:
String - the system ID for the Source.

setSystemID

public void setSystemID(java.lang.String systemID)

This will set the system ID for this Source. This is important to use, even when input is in the form of an input stream (see StreamSource) for resolving external references, such as to a DTD.

Specified by:
setSystemID in interface Source
Parameters:
systemID - String system ID to use.

getDocument

public abstract org.jdom.Document getDocument()
                                       throws java.io.IOException

This will return a JDOM Document that represents the input source.

Specified by:
getDocument in interface Source
Returns:
Document - the JDOM representation of the input source.
Throws:
IOException - - when construction of a Document generates errors.

setEntityResolver

public void setEntityResolver(org.xml.sax.EntityResolver entityResolver)

This will set an EntityResolver for this Source. This is passed to the underlying parser to use.

Specified by:
setEntityResolver in interface Source
Parameters:
entityResolver - org.xml.sax.EntityResolver Entity Resolver to use.


Copyright © 2001 Enhydra. All Rights Reserved.