Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.iicm.xpg.statemachine
Class XMLHandler  view XMLHandler download XMLHandler.java

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byedu.iicm.xpg.statemachine.XMLHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class XMLHandler
extends org.xml.sax.helpers.DefaultHandler

This class extends the DefaultHandler of the SAX2.0 API. It sends the XMLInputs to the statemachine.

Version:
$revision$

Field Summary
protected  DataObject data_
           
protected  PrimitiveStateMachine state_machine_
           
 
Constructor Summary
XMLHandler(PrimitiveStateMachine state_machine, DataObject data)
           
 
Method Summary
 void characters(char[] chars, int start, int length)
          Receive notification of character data inside an element.
 void endDocument()
          Receive notification of the end of the document.
 void endElement(java.lang.String uri, java.lang.String name, java.lang.String qname)
          Receive notification of the end of an element.
 void error(org.xml.sax.SAXParseException exc)
          Receive notification of a recoverable parser error.
 void fatalError(org.xml.sax.SAXParseException exc)
          Report a fatal XML parsing error.
 void ignorableWhitespace(char[] ch, int start, int length)
          Receive notification of ignorable whitespace in element content.
 void startDocument()
          Receive notification of the beginning of the document.
 void startElement(java.lang.String uri, java.lang.String name, java.lang.String qname, org.xml.sax.Attributes attributes)
          Receive notification of the start of an element.
 void warning(org.xml.sax.SAXParseException exc)
          Receive notification of a parser warning.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state_machine_

protected PrimitiveStateMachine state_machine_

data_

protected DataObject data_
Constructor Detail

XMLHandler

public XMLHandler(PrimitiveStateMachine state_machine,
                  DataObject data)
           throws java.lang.IllegalArgumentException
Method Detail

startDocument

public void startDocument()
Description copied from class: org.xml.sax.helpers.DefaultHandler
Receive notification of the beginning of the document.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the beginning of a document (such as allocating the root node of a tree or creating an output file).


endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Description copied from class: org.xml.sax.helpers.DefaultHandler
Receive notification of the end of the document.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of a document (such as finalising a tree or closing an output file).


characters

public void characters(char[] chars,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Description copied from class: org.xml.sax.helpers.DefaultHandler
Receive notification of character data inside an element.

By default, do nothing. Application writers may override this method to take specific actions for each chunk of character data (such as adding the data to a node or buffer, or printing it to a file).


startElement

public void startElement(java.lang.String uri,
                         java.lang.String name,
                         java.lang.String qname,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Description copied from class: org.xml.sax.helpers.DefaultHandler
Receive notification of the start of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).


endElement

public void endElement(java.lang.String uri,
                       java.lang.String name,
                       java.lang.String qname)
                throws org.xml.sax.SAXException
Description copied from class: org.xml.sax.helpers.DefaultHandler
Receive notification of the end of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).


ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
Description copied from class: org.xml.sax.helpers.DefaultHandler
Receive notification of ignorable whitespace in element content.

By default, do nothing. Application writers may override this method to take specific actions for each chunk of ignorable whitespace (such as adding data to a node or buffer, or printing it to a file).


error

public void error(org.xml.sax.SAXParseException exc)
           throws org.xml.sax.SAXException
Description copied from class: org.xml.sax.helpers.DefaultHandler
Receive notification of a recoverable parser error.

The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each error, such as inserting the message in a log file or printing it to the console.


fatalError

public void fatalError(org.xml.sax.SAXParseException exc)
                throws org.xml.sax.SAXException
Description copied from class: org.xml.sax.helpers.DefaultHandler
Report a fatal XML parsing error.

The default implementation throws a SAXParseException. Application writers may override this method in a subclass if they need to take specific actions for each fatal error (such as collecting all of the errors into a single report): in any case, the application must stop all regular processing when this method is invoked, since the document is no longer reliable, and the parser may no longer report parsing events.


warning

public void warning(org.xml.sax.SAXParseException exc)
Description copied from class: org.xml.sax.helpers.DefaultHandler
Receive notification of a parser warning.

The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each warning, such as inserting the message in a log file or printing it to the console.