Interface IXMLReader

All Known Implementing Classes:
StdXMLReader

public interface IXMLReader
IXMLReader reads the data to be parsed.
Author:
Marc De Scheemaecker
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if there are no more characters left to be read.
    boolean
    Returns true if the current stream has no more characters left to be read.
    int
    Returns the line number of the data in the current stream.
    Returns the current public ID.
    int
    Returns the current "level" of the stream on the stack of streams.
    Returns the current system ID.
    openStream(String publicID, String systemID)
    Opens a stream from a public and system ID.
    char
    Reads a character.
    void
    setPublicID(String publicID)
    Sets the public ID of the current stream.
    void
    setSystemID(String systemID)
    Sets the system ID of the current stream.
    void
    Starts a new stream from a Java reader.
    void
    startNewStream(Reader reader, boolean isInternalEntity)
    Starts a new stream from a Java reader.
    void
    unread(char ch)
    Pushes the last character read back to the stream.
  • Method Details

    • read

      char read() throws IOException
      Reads a character.
      Returns:
      the character
      Throws:
      IOException - If no character could be read.
    • atEOFOfCurrentStream

      boolean atEOFOfCurrentStream() throws IOException
      Returns true if the current stream has no more characters left to be read.
      Throws:
      IOException - If an I/O error occurred.
    • atEOF

      boolean atEOF() throws IOException
      Returns true if there are no more characters left to be read.
      Throws:
      IOException - If an I/O error occurred.
    • unread

      void unread(char ch) throws IOException
      Pushes the last character read back to the stream.
      Parameters:
      ch - the character to push back.
      Throws:
      IOException - If an I/O error occurred.
    • getLineNr

      int getLineNr()
      Returns the line number of the data in the current stream.
    • openStream

      Reader openStream(String publicID, String systemID) throws MalformedURLException, FileNotFoundException, IOException
      Opens a stream from a public and system ID.
      Parameters:
      publicID - the public ID, which may be null.
      systemID - the system ID, which is never null.
      Throws:
      MalformedURLException - If the system ID does not contain a valid URL.
      FileNotFoundException - If the system ID refers to a local file which does not exist.
      IOException - If an error occurred opening the stream.
    • startNewStream

      void startNewStream(Reader reader)
      Starts a new stream from a Java reader. The new stream is used temporary to read data from. If that stream is exhausted, control returns to the "parent" stream.
      Parameters:
      reader - the reader to read the new data from.
    • startNewStream

      void startNewStream(Reader reader, boolean isInternalEntity)
      Starts a new stream from a Java reader. The new stream is used temporary to read data from. If that stream is exhausted, control returns to the parent stream.
      Parameters:
      reader - the non-null reader to read the new data from
      isInternalEntity - true if the reader is produced by resolving an internal entity
    • getStreamLevel

      int getStreamLevel()
      Returns the current "level" of the stream on the stack of streams.
    • setSystemID

      void setSystemID(String systemID) throws MalformedURLException
      Sets the system ID of the current stream.
      Parameters:
      systemID - the system ID.
      Throws:
      MalformedURLException - If the system ID does not contain a valid URL.
    • setPublicID

      void setPublicID(String publicID)
      Sets the public ID of the current stream.
      Parameters:
      publicID - the public ID.
    • getSystemID

      String getSystemID()
      Returns the current system ID.
    • getPublicID

      String getPublicID()
      Returns the current public ID.