FileDocCategorySizeDatePackage
XMLInputSource.javaAPI DocJava SE 6 API8590Tue Jun 10 00:22:54 BST 2008com.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.2.6.1 2005/09/06 08:31:30 neerajbj 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;
    
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;