org.enhydra.zeus.source
Class StreamSource

java.lang.Object
  |
  +--org.enhydra.zeus.source.BaseSource
        |
        +--org.enhydra.zeus.source.StreamSource
All Implemented Interfaces:
Source

public class StreamSource
extends BaseSource

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 deals with input from Java I/O streams, such as InputStreams and Readers. It allows passing in of these types of constructs and subsequent reading of them, through various constructors.

Author:
Brett McLaughlin

Fields inherited from class org.enhydra.zeus.source.BaseSource
entityResolver, systemID
 
Constructor Summary
StreamSource(java.io.InputStream inputStream)
           This will take in an InputStream and read XML from that stream when asked, converting the read XML into a Document as needed.
StreamSource(java.io.InputStream inputStream, java.lang.String systemID)
           This will take in an InputStream and read XML from that stream when asked, converting the read XML into a Document as needed.
StreamSource(java.io.Reader reader)
           This will take in a Reader and read XML from that stream when asked, converting the read XML into a Document as needed.
StreamSource(java.io.Reader reader, java.lang.String systemID)
           This will take in a Reader and read XML from that stream when asked, converting the read XML into a Document as needed.
 
Method Summary
 org.jdom.Document getDocument()
           This will return a JDOM Document that represents the input source.
 
Methods inherited from class org.enhydra.zeus.source.BaseSource
getSystemID, setEntityResolver, setSystemID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamSource

public StreamSource(java.io.InputStream inputStream,
                    java.lang.String systemID)

This will take in an InputStream and read XML from that stream when asked, converting the read XML into a Document as needed. It also takes in a system ID for resolution of external references.

Parameters:
inputStream - InputStream to read from.
systemID - String system ID for input document.

StreamSource

public StreamSource(java.io.InputStream inputStream)

This will take in an InputStream and read XML from that stream when asked, converting the read XML into a Document as needed. It assumes that no system ID is present; for passing in a system ID, see StreamSource(InputStream, String).

Parameters:
inputStream - InputStream to read from.

StreamSource

public StreamSource(java.io.Reader reader,
                    java.lang.String systemID)

This will take in a Reader and read XML from that stream when asked, converting the read XML into a Document as needed. It also takes in a system ID for resolution of external references.

Parameters:
reader - Reader to read from.
systemID - String system ID for input document.

StreamSource

public StreamSource(java.io.Reader reader)

This will take in a Reader and read XML from that stream when asked, converting the read XML into a Document as needed. It assumes that no system ID is present; for passing in a system ID, see StreamSource(Reader, String).

Parameters:
reader - Reader to read from.
Method Detail

getDocument

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

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

Overrides:
getDocument in class BaseSource
Returns:
Document - the JDOM representation of the input source.
Throws:
IOException - - when construction of a Document generates errors.


Copyright © 2001 Enhydra. All Rights Reserved.