Class XMLReader

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.PushbackInputStream
com.softsynth.util.XMLReader
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable

public class XMLReader
extends java.io.PushbackInputStream
Parse an XML stream using a simple State Machine XMLReader does not buffer the input stream so you may want to do that yourself using a BufferedInputStream.
Author:
(C) 1997 Phil Burk, All Rights Reserved
See Also:
XMLListener, XMLPrinter
  • Constructor Summary

    Constructors
    Constructor Description
    XMLReader​(java.io.InputStream stream)  
  • Method Summary

    Modifier and Type Method Description
    static double getAttribute​(java.util.Hashtable attributes, java.lang.String key, double defaultValue)
    Get a single attribute from the Hashtable.
    static int getAttribute​(java.util.Hashtable attributes, java.lang.String key, int defaultValue)
    Get a single attribute from the Hashtable.
    void parse()  
    void setXMLListener​(XMLListener listener)  

    Methods inherited from class java.io.PushbackInputStream

    available, close, mark, markSupported, read, read, reset, skip, unread, unread, unread

    Methods inherited from class java.io.FilterInputStream

    read

    Methods inherited from class java.io.InputStream

    nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • XMLReader

      public XMLReader​(java.io.InputStream stream)
  • Method Details

    • setXMLListener

      public void setXMLListener​(XMLListener listener)
    • parse

      public void parse() throws java.io.IOException
      Throws:
      java.io.IOException
    • getAttribute

      public static int getAttribute​(java.util.Hashtable attributes, java.lang.String key, int defaultValue)
      Get a single attribute from the Hashtable. Use the default if not found.
    • getAttribute

      public static double getAttribute​(java.util.Hashtable attributes, java.lang.String key, double defaultValue)
      Get a single attribute from the Hashtable. Use the default if not found.