FileDocCategorySizeDatePackage
XMLInputSource.javaAPI DocJava SE 5 API11268Fri Aug 26 14:55:58 BST 2005com.sun.org.apache.xerces.internal.xni.parser

XMLInputSource

public class XMLInputSource extends Object
This class represents an input source for an XML document. The basic properties of an input source are the following:
  • public identifier
  • system identifier
  • byte stream or character stream
author
Andy Clark, IBM
version
$Id: XMLInputSource.java,v 1.4 2002/01/29 01:15:19 lehors Exp $

Fields Summary
protected String
fPublicId
Public identifier.
protected String
fSystemId
System identifier.
protected String
fBaseSystemId
Base system identifier.
protected InputStream
fByteStream
Byte stream.
protected Reader
fCharStream
Character stream.
protected String
fEncoding
Encoding.
Constructors Summary
public XMLInputSource(String publicId, String systemId, String baseSystemId)
Constructs an input source from just the public and system identifiers, leaving resolution of the entity and opening of the input stream up to the caller.

param
publicId The public identifier, if known.
param
systemId The system identifier. This value should always be set, if possible, and can be relative or absolute. If the system identifier is relative, then the base system identifier should be set.
param
baseSystemId The base system identifier. This value should always be set to the fully expanded URI of the base system identifier, if possible.

        fPublicId = publicId;
        fSystemId = systemId;
        fBaseSystemId = baseSystemId;
    
public XMLInputSource(XMLResourceIdentifier resourceIdentifier)
Constructs an input source from a XMLResourceIdentifier object, leaving resolution of the entity and opening of the input stream up to the caller.

param
resourceIdentifier the XMLResourceIdentifier containing the information


        fPublicId = resourceIdentifier.getPublicId();
        fSystemId = resourceIdentifier.getLiteralSystemId();
        fBaseSystemId = resourceIdentifier.getBaseSystemId();
    
public XMLInputSource(String publicId, String systemId, String baseSystemId, InputStream byteStream, String encoding)
Constructs an input source from a byte stream.

param
publicId The public identifier, if known.
param
systemId The system identifier. This value should always be set, if possible, and can be relative or absolute. If the system identifier is relative, then the base system identifier should be set.
param
baseSystemId The base system identifier. This value should always be set to the fully expanded URI of the base system identifier, if possible.
param
byteStream The byte stream.
param
encoding The encoding of the byte stream, if known.

        fPublicId = publicId;
        fSystemId = systemId;
        fBaseSystemId = baseSystemId;
        fByteStream = byteStream;
        fEncoding = encoding;
    
public XMLInputSource(String publicId, String systemId, String baseSystemId, Reader charStream, String encoding)
Constructs an input source from a character stream.

param
publicId The public identifier, if known.
param
systemId The system identifier. This value should always be set, if possible, and can be relative or absolute. If the system identifier is relative, then the base system identifier should be set.
param
baseSystemId The base system identifier. This value should always be set to the fully expanded URI of the base system identifier, if possible.
param
charStream The character stream.
param
encoding The original encoding of the byte stream used by the reader, if known.

        fPublicId = publicId;
        fSystemId = systemId;
        fBaseSystemId = baseSystemId;
        fCharStream = charStream;
        fEncoding = encoding;
    
public XMLInputSource(StreamSource source)
Constructs an input source from {@link StreamSource}.

        fPublicId = source.getPublicId();
        fSystemId = source.getSystemId();
        fCharStream = source.getReader();
        fByteStream = source.getInputStream();
    
Methods Summary
public java.lang.StringgetBaseSystemId()
Returns the base system identifier.

        return fBaseSystemId;
    
public java.io.InputStreamgetByteStream()
Returns the byte stream.

        return fByteStream;
    
public java.io.ReadergetCharacterStream()
Returns the character stream.

        return fCharStream;
    
public java.lang.StringgetEncoding()
Returns the encoding of the stream, or null if not known.

        return fEncoding;
    
public java.lang.StringgetPublicId()
Returns the public identifier.

        return fPublicId;
    
public java.lang.StringgetSystemId()
Returns the system identifier.

        return fSystemId;
    
public voidsetBaseSystemId(java.lang.String baseSystemId)
Sets the base system identifier.

param
baseSystemId The new base system identifier.

        fBaseSystemId = baseSystemId;
    
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.

        fByteStream = 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

        fCharStream = charStream;
    
public voidsetEncoding(java.lang.String encoding)
Sets the encoding of the stream.

param
encoding The new encoding.

        fEncoding = encoding;
    
public voidsetPublicId(java.lang.String publicId)
Sets the public identifier.

param
publicId The new public identifier.

        fPublicId = publicId;
    
public voidsetSystemId(java.lang.String systemId)
Sets the system identifier.

param
systemId The new system identifier.

        fSystemId = systemId;
    
public final com.sun.org.apache.xerces.internal.util.XMLInputSourceAdaptortoSource()
Wraps this object into a {@link Source} object.

        return new XMLInputSourceAdaptor(this);