FileDocCategorySizeDatePackage
SAXInputSource.javaAPI DocJava SE 6 API5220Tue Jun 10 00:22:52 BST 2008com.sun.org.apache.xerces.internal.util

SAXInputSource

public final class SAXInputSource extends XMLInputSource

An XMLInputSource analogue to javax.xml.transform.sax.SAXSource.

version
$Id: SAXInputSource.java,v 1.1.4.1 2005/09/05 09:04:49 neerajbj Exp $

Fields Summary
private XMLReader
fXMLReader
private InputSource
fInputSource
Constructors Summary
public SAXInputSource()

        this(null);
    
public SAXInputSource(InputSource inputSource)

        this(null, inputSource);
    
public SAXInputSource(XMLReader reader, InputSource inputSource)

        super(inputSource != null ? inputSource.getPublicId() : null, 
                inputSource != null ? inputSource.getSystemId() : null, null);
        if (inputSource != null) {
            setByteStream(inputSource.getByteStream());
            setCharacterStream(inputSource.getCharacterStream());
            setEncoding(inputSource.getEncoding());
        }
        fInputSource = inputSource;
        fXMLReader = reader;
    
Methods Summary
public org.xml.sax.InputSourcegetInputSource()

        return fInputSource;
    
public org.xml.sax.XMLReadergetXMLReader()

        return fXMLReader;
    
public voidsetByteStream(java.io.InputStream byteStream)
Sets the byte stream. If the byte stream is not already opened when this object is instantiated, then the code that opens the stream should also set the byte stream on this object. Also, if the encoding is auto-detected, then the encoding should also be set on this object.

param
byteStream The new byte stream.

        super.setByteStream(byteStream);
        if (fInputSource == null) {
            fInputSource = new InputSource();
        }
        fInputSource.setByteStream(byteStream);
    
public voidsetCharacterStream(java.io.Reader charStream)
Sets the character stream. If the character stream is not already opened when this object is instantiated, then the code that opens the stream should also set the character stream on this object. Also, the encoding of the byte stream used by the reader should also be set on this object, if known.

param
charStream The new character stream.
see
#setEncoding

        super.setCharacterStream(charStream);
        if (fInputSource == null) {
            fInputSource = new InputSource();
        }
        fInputSource.setCharacterStream(charStream);
    
public voidsetEncoding(java.lang.String encoding)
Sets the encoding of the stream.

param
encoding The new encoding.

        super.setEncoding(encoding);
        if (fInputSource == null) {
            fInputSource = new InputSource();
        }
        fInputSource.setEncoding(encoding);
    
public voidsetInputSource(org.xml.sax.InputSource inputSource)

        if (inputSource != null) {
            setPublicId(inputSource.getPublicId());
            setSystemId(inputSource.getSystemId());
            setByteStream(inputSource.getByteStream());
            setCharacterStream(inputSource.getCharacterStream());
            setEncoding(inputSource.getEncoding());
        }
        else {
            setPublicId(null);
            setSystemId(null);
            setByteStream(null);
            setCharacterStream(null);
            setEncoding(null);
        }
        fInputSource = inputSource;
    
public voidsetPublicId(java.lang.String publicId)
Sets the public identifier.

param
publicId The new public identifier.

        super.setPublicId(publicId);
        if (fInputSource == null) {
            fInputSource = new InputSource();
        }
        fInputSource.setPublicId(publicId);
    
public voidsetSystemId(java.lang.String systemId)
Sets the system identifier.

param
systemId The new system identifier.

        super.setSystemId(systemId);
        if (fInputSource == null) {
            fInputSource = new InputSource();
        }
        fInputSource.setSystemId(systemId);
    
public voidsetXMLReader(org.xml.sax.XMLReader reader)

        fXMLReader = reader;