com.softsynth.util
Class XMLReader

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

public class XMLReader
extends java.io.PushbackInputStream

Parse an XML stream using a simple State Machine

Author:
(C) 1997 Phil Burk, All Rights Reserved
See Also:
XMLListener

Constructor Summary
XMLReader(java.io.InputStream stream)
           
 
Method Summary
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.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLReader

public XMLReader(java.io.InputStream stream)
Method Detail

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.