org.objectweb.fractal.adl.xml
Class XMLParser

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.objectweb.fractal.adl.xml.XMLParser
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, Parser

public class XMLParser
extends org.xml.sax.helpers.DefaultHandler
implements Parser

An extensible XML parser that constructs strongly typed abstract syntax trees.


Constructor Summary
XMLParser()
           
XMLParser(boolean validate)
           
 
Method Summary
 void endElement(String uri, String localName, String qualifiedName)
           
 void error(org.xml.sax.SAXParseException e)
           
 void fatalError(org.xml.sax.SAXParseException e)
           
 Node parse(InputStream is, String name)
          Parses the given input stream and constructs the corresponding AST.
 org.xml.sax.InputSource resolveEntity(String publicId, String systemId)
           
 void setDocumentLocator(org.xml.sax.Locator locator)
           
 void startElement(String uri, String localName, String qualifiedName, org.xml.sax.Attributes attributes)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLParser

public XMLParser()

XMLParser

public XMLParser(boolean validate)
Method Detail

parse

public Node parse(InputStream is,
                  String name)
           throws ParserException
Description copied from interface: Parser
Parses the given input stream and constructs the corresponding AST.

Specified by:
parse in interface Parser
Parameters:
is - the input stream that must be parsed.
name - the source of this input stream (such as a file name).
Returns:
the AST corresponding to the given input stream content.
Throws:
ParserException - if an error occurs during parsing.

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler

resolveEntity

public org.xml.sax.InputSource resolveEntity(String publicId,
                                             String systemId)
                                      throws org.xml.sax.SAXException
Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
Throws:
org.xml.sax.SAXException

startElement

public void startElement(String uri,
                         String localName,
                         String qualifiedName,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String qualifiedName)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

error

public void error(org.xml.sax.SAXParseException e)
           throws org.xml.sax.SAXException
Specified by:
error in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

fatalError

public void fatalError(org.xml.sax.SAXParseException e)
                throws org.xml.sax.SAXException
Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException