net.sourceforge.jeuclid
Class SAXBuilder

java.lang.Object
  extended by net.sourceforge.jeuclid.SAXBuilder
All Implemented Interfaces:
ContentHandler

public class SAXBuilder
extends Object
implements ContentHandler

Generator for creating a MathElement tree from SAX events.

Version:
$Revision: 422 $
Author:
Stephan Michels, Max Berger

Constructor Summary
SAXBuilder()
          default constructor.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Receive notification of character data.
 void endDocument()
          Receive notification of the end of a document.
 void endElement(String namespaceURI, String localName, String qName)
          Receive notification of the end of an element.
 void endPrefixMapping(String prefix)
          End the scope of a prefix-URI mapping.
 DocumentElement getMathRootElement()
          Returns the created math root element.
 void ignorableWhitespace(char[] ch, int start, int length)
          Receive notification of ignorable whitespace in element content.
 void processingInstruction(String target, String data)
          Receive notification of a processing instruction.
 void setDocumentLocator(Locator locator)
          Receive an object for locating the origin of SAX document events.
 void skippedEntity(String name)
          Receive notification of a skipped entity.
 void startDocument()
          Receive notification of the beginning of a document.
 void startElement(String namespaceURI, String localName, String qName, Attributes attributes)
          Receive notification of the beginning of an element.
 void startPrefixMapping(String prefix, String uri)
          Begin the scope of a prefix-URI Namespace mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXBuilder

public SAXBuilder()
default constructor.

Method Detail

getMathRootElement

public DocumentElement getMathRootElement()
Returns the created math root element.

Returns:
Math root element

characters

public void characters(char[] ch,
                       int start,
                       int length)
Receive notification of character data.

Specified by:
characters in interface ContentHandler
Parameters:
ch - The characters from the XML document.
start - The start position in the array.
length - The number of characters to read from the array.

endDocument

public void endDocument()
Receive notification of the end of a document.

Specified by:
endDocument in interface ContentHandler

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
Receive notification of the end of an element.

Specified by:
endElement in interface ContentHandler
Parameters:
namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - The qualified XML 1.0 name (with prefix), or the empty string if qualified names are not available.

startDocument

public void startDocument()
Receive notification of the beginning of a document.

Specified by:
startDocument in interface ContentHandler

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes attributes)
Receive notification of the beginning of an element.

Specified by:
startElement in interface ContentHandler
Parameters:
namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - The qualified name (with prefix), or the empty string if qualified names are not available.
attributes - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.

endPrefixMapping

public void endPrefixMapping(String prefix)
End the scope of a prefix-URI mapping.

Specified by:
endPrefixMapping in interface ContentHandler
Parameters:
prefix - Prefix

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
Receive notification of ignorable whitespace in element content.

Specified by:
ignorableWhitespace in interface ContentHandler
Parameters:
ch - Space char
start - Start position
length - Length

processingInstruction

public void processingInstruction(String target,
                                  String data)
Receive notification of a processing instruction.

Specified by:
processingInstruction in interface ContentHandler
Parameters:
target - Target
data - Data

setDocumentLocator

public void setDocumentLocator(Locator locator)
Receive an object for locating the origin of SAX document events.

Specified by:
setDocumentLocator in interface ContentHandler
Parameters:
locator - Locator

skippedEntity

public void skippedEntity(String name)
Receive notification of a skipped entity.

Specified by:
skippedEntity in interface ContentHandler
Parameters:
name - Entity name

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
Begin the scope of a prefix-URI Namespace mapping.

Specified by:
startPrefixMapping in interface ContentHandler
Parameters:
prefix - Prefix
uri - Uri


Copyright © 2002-2008 The JEuclid project. All Rights Reserved.