All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jp.kyasu.sgml.SGMLParser

java.lang.Object
   |
   +----jp.kyasu.sgml.SGMLParser

public class SGMLParser
extends Object
implements Serializable
A SGMLParser parses the SGML document according to the specified DTD and delivers the sgml events to the listeners (SGMLParserListeners).

For example:

     Reader reader = new BufferedReader(new InputStreamReader(System.in));
     DTD dtd = new DTD();
     // Setups the dtd.
     SGMLParser parser = new SGMLParser(dtd);
     parser.addSGMLParserListener(new SGMLParserListener(){});
     try {
         parser.parse(reader);
     }
     catch (IOException e) {}
 
Refers to "ISO 8879 -- Standard Generalized Markup Language (SGML)".

Version:
14 Nov 1997
Author:
Kazuki YASUMATSU
See Also:
DTD, SGMLEvent, SGMLParserListener

Constructor Index

 o SGMLParser(DTD)
Constructs a sgml parser with the specified dtd.

Method Index

 o addSGMLParserListener(SGMLParserListener)
Adds the specified sgml parser listener to receive sgml events from this parser.
 o parse(Reader)
Parses the sgml document contained in the specified reader.
 o removeSGMLParserListener(SGMLParserListener)
Removes the specified sgml parser listener so it no longer receives sgml events from this parser.

Constructors

 o SGMLParser
 public SGMLParser(DTD dtd)
Constructs a sgml parser with the specified dtd.

Parameters:
dtd - the specified dtd.

Methods

 o addSGMLParserListener
 public void addSGMLParserListener(SGMLParserListener l)
Adds the specified sgml parser listener to receive sgml events from this parser.

Parameters:
l - the sgml parser listener
 o removeSGMLParserListener
 public void removeSGMLParserListener(SGMLParserListener l)
Removes the specified sgml parser listener so it no longer receives sgml events from this parser.

Parameters:
l - the sgml parser listener
 o parse
 public void parse(Reader reader) throws IOException
Parses the sgml document contained in the specified reader. The sgml events are delivered to the listeners of this parser.

Parameters:
reader - the reader that contains the sgml document.
Throws: IOException
If an I/O error occurs.

All Packages  Class Hierarchy  This Package  Previous  Next  Index