Search this API

y.io.gml
Class XGMLTokenizer

java.lang.Object
  extended by y.io.gml.XGMLTokenizer

public class XGMLTokenizer
extends java.lang.Object

This class is used to parse a valid stream from a reader, which contains well formed xgml. A callback method must be registered with this class, whose methods will be invoked during the parsing of the stream.

Note that this class can only be used with J2SE 1.4 or higher.

 

Constructor Summary
XGMLTokenizer()
          Creates a new instance of GMLTokenizer.
XGMLTokenizer(GMLTokenizer.Callback callback)
          Creates a new instance of GMLTokenizer and installs the given callback.
 
Method Summary
 GMLTokenizer.Callback getCallback()
          Getter for property callback.
 void parse(org.xml.sax.InputSource source)
          Starts the parsing and will fire events to the registered callback.
protected  void parse(org.xml.sax.InputSource source, org.xml.sax.ContentHandler handler)
          Parses an XGML document.
 void parse(java.io.Reader reader)
          Deprecated. This method does not handle encodings correctly, use parse(org.xml.sax.InputSource) instead.
 void setCallback(GMLTokenizer.Callback callback)
          Setter for property callback.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XGMLTokenizer

public XGMLTokenizer()
Creates a new instance of GMLTokenizer.


XGMLTokenizer

public XGMLTokenizer(GMLTokenizer.Callback callback)
Creates a new instance of GMLTokenizer and installs the given callback.

Parameters:
callback - the callback to be used
Method Detail

parse

public void parse(java.io.Reader reader)
           throws java.io.IOException
Deprecated. This method does not handle encodings correctly, use parse(org.xml.sax.InputSource) instead.

Starts the parsing and will fire events to the registered callback.

Parameters:
reader - the stream to be parsed
Throws:
java.io.IOException - in the case of an I/O Exception

parse

public void parse(org.xml.sax.InputSource source)
           throws java.io.IOException
Starts the parsing and will fire events to the registered callback.

Parameters:
source - the input source to be parsed
Throws:
java.io.IOException - in the case of an I/O Exception

parse

protected void parse(org.xml.sax.InputSource source,
                     org.xml.sax.ContentHandler handler)
              throws java.io.IOException,
                     javax.xml.parsers.ParserConfigurationException,
                     org.xml.sax.SAXException
Parses an XGML document.

Parameters:
source - the input source to be parsed.
handler - the handler for content events that are emitted while parsing the given XGML document.
Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

getCallback

public GMLTokenizer.Callback getCallback()
Getter for property callback.

Returns:
Value of property callback.

setCallback

public void setCallback(GMLTokenizer.Callback callback)
Setter for property callback.

Parameters:
callback - New value of property callback.

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.