java.lang.Object
org.htmlunit.cyberneko.xerces.xni.parser.XMLInputSource

public class XMLInputSource extends Object
Represents an input source for an XML document. The basic properties of an input source are:
  • Public identifier
  • System identifier
  • Base system identifier
  • Byte stream or character stream
  • Encoding
Author:
Andy Clark, IBM, Ronald Brill
  • Constructor Details

    • XMLInputSource

      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.
      Parameters:
      publicId - the public identifier, if known
      systemId - the system identifier (can be relative or absolute)
      baseSystemId - the base system identifier as a fully expanded URI, if known
    • XMLInputSource

      public XMLInputSource(String publicId, String systemId, String baseSystemId, InputStream byteStream, String encoding)
      Constructs an input source from a byte stream.
      Parameters:
      publicId - the public identifier, if known
      systemId - the system identifier (can be relative or absolute)
      baseSystemId - the base system identifier as a fully expanded URI, if known
      byteStream - the byte stream
      encoding - the encoding of the byte stream, if known
    • XMLInputSource

      public XMLInputSource(String publicId, String systemId, String baseSystemId, Reader charStream, String encoding)
      Constructs an input source from a character stream.
      Parameters:
      publicId - the public identifier, if known
      systemId - the system identifier (can be relative or absolute)
      baseSystemId - the base system identifier as a fully expanded URI, if known
      charStream - the character stream
      encoding - the original encoding of the byte stream used by the reader, if known
  • Method Details

    • setPublicId

      public void setPublicId(String publicId)
      Sets the public identifier.
      Parameters:
      publicId - the new public identifier
    • getPublicId

      public String getPublicId()
      Returns the public identifier.
      Returns:
      the public identifier, or null if not specified
    • setSystemId

      public void setSystemId(String systemId)
      Sets the system identifier.
      Parameters:
      systemId - the new system identifier
    • getSystemId

      public String getSystemId()
      Returns the system identifier.
      Returns:
      the system identifier, or null if not specified
    • setBaseSystemId

      public void setBaseSystemId(String baseSystemId)
      Sets the base system identifier.
      Parameters:
      baseSystemId - the new base system identifier
    • getBaseSystemId

      public String getBaseSystemId()
      Returns the base system identifier.
      Returns:
      the base system identifier, or null if not specified
    • setByteStream

      public void setByteStream(InputStream byteStream)
      Sets the byte stream. If the byte stream is not already opened when this object is instantiated, the code opening the stream should set the byte stream here.
      Parameters:
      byteStream - the new byte stream
    • getByteStream

      public InputStream getByteStream()
      Returns the byte stream.
      Returns:
      the byte stream, or null if none is set
    • setCharacterStream

      public void setCharacterStream(Reader charStream)
      Sets the character stream. If the character stream is not already opened when this object is instantiated, the code opening the stream should set the character stream here.
      Parameters:
      charStream - the new character stream
      See Also:
    • getCharacterStream

      public Reader getCharacterStream()
      Returns the character stream.
      Returns:
      the character stream, or null if none is set
    • setEncoding

      public void setEncoding(String encoding)
      Sets the encoding of the stream.
      Parameters:
      encoding - the new encoding
    • getEncoding

      public String getEncoding()
      Returns the encoding of the stream.
      Returns:
      the encoding, or null if not known