FreeHEP API
Version current

hep.aida.ref.xml
Class AidaParser

java.lang.Object
  extended byhep.aida.ref.xml.AidaParser
All Implemented Interfaces:
ContentHandler

public class AidaParser
extends Object
implements ContentHandler

The class reads XML documents according to specified DTD and translates all related events into AidaHandler events.

Usage sample:

    AidaParser parser = new AidaParser(...);
    parser.parse(new InputSource("..."));
 

Warning: the class is machine generated. DO NOT MODIFY

Source Code:
AidaParser.java

Constructor Summary
AidaParser(AidaHandler handler, EntityResolver resolver)
          Creates a parser instance.
 
Method Summary
 void characters(char[] chars, int start, int len)
          This SAX interface method is implemented by the parser.
 void endDocument()
          This SAX interface method is implemented by the parser.
 void endElement(String ns, String name, String qname)
          This SAX interface method is implemented by the parser.
 void endPrefixMapping(String prefix)
          This SAX interface method is implemented by the parser.
protected  ErrorHandler getDefaultErrorHandler()
          Creates default error handler used by this parser.
 void ignorableWhitespace(char[] chars, int start, int len)
          This SAX interface method is implemented by the parser.
 void parse(InputSource input)
          The recognizer entry method taking an InputSource.
static void parse(InputSource input, AidaHandler handler)
          The recognizer entry method taking an Inputsource.
 void parse(URL url)
          The recognizer entry method taking a URL.
static void parse(URL url, AidaHandler handler)
          The recognizer entry method taking a URL.
 void processingInstruction(String target, String data)
          This SAX interface method is implemented by the parser.
 void setDocumentLocator(Locator locator)
          This SAX interface method is implemented by the parser.
 void setValidate(boolean validate)
           
 void skippedEntity(String name)
          This SAX interface method is implemented by the parser.
 void startDocument()
          This SAX interface method is implemented by the parser.
 void startElement(String ns, String name, String qname, Attributes attrs)
          This SAX interface method is implemented by the parser.
 void startPrefixMapping(String prefix, String uri)
          This SAX interface method is implemented by the parser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AidaParser

public AidaParser(AidaHandler handler,
                  EntityResolver resolver)
Creates a parser instance.

Parameters:
handler - handler interface implementation (never null
resolver - SAX entity resolver implementation or null. It is recommended that it could be able to resolve at least the DTD.
Method Detail

setDocumentLocator

public final void setDocumentLocator(Locator locator)
This SAX interface method is implemented by the parser.

Specified by:
setDocumentLocator in interface ContentHandler

startDocument

public final void startDocument()
                         throws SAXException
This SAX interface method is implemented by the parser.

Specified by:
startDocument in interface ContentHandler
Throws:
SAXException

endDocument

public final void endDocument()
                       throws SAXException
This SAX interface method is implemented by the parser.

Specified by:
endDocument in interface ContentHandler
Throws:
SAXException

startElement

public final void startElement(String ns,
                               String name,
                               String qname,
                               Attributes attrs)
                        throws SAXException
This SAX interface method is implemented by the parser.

Specified by:
startElement in interface ContentHandler
Throws:
SAXException

endElement

public final void endElement(String ns,
                             String name,
                             String qname)
                      throws SAXException
This SAX interface method is implemented by the parser.

Specified by:
endElement in interface ContentHandler
Throws:
SAXException

characters

public final void characters(char[] chars,
                             int start,
                             int len)
                      throws SAXException
This SAX interface method is implemented by the parser.

Specified by:
characters in interface ContentHandler
Throws:
SAXException

ignorableWhitespace

public final void ignorableWhitespace(char[] chars,
                                      int start,
                                      int len)
                               throws SAXException
This SAX interface method is implemented by the parser.

Specified by:
ignorableWhitespace in interface ContentHandler
Throws:
SAXException

processingInstruction

public final void processingInstruction(String target,
                                        String data)
                                 throws SAXException
This SAX interface method is implemented by the parser.

Specified by:
processingInstruction in interface ContentHandler
Throws:
SAXException

startPrefixMapping

public final void startPrefixMapping(String prefix,
                                     String uri)
                              throws SAXException
This SAX interface method is implemented by the parser.

Specified by:
startPrefixMapping in interface ContentHandler
Throws:
SAXException

endPrefixMapping

public final void endPrefixMapping(String prefix)
                            throws SAXException
This SAX interface method is implemented by the parser.

Specified by:
endPrefixMapping in interface ContentHandler
Throws:
SAXException

skippedEntity

public final void skippedEntity(String name)
                         throws SAXException
This SAX interface method is implemented by the parser.

Specified by:
skippedEntity in interface ContentHandler
Throws:
SAXException

parse

public void parse(InputSource input)
           throws SAXException,
                  ParserConfigurationException,
                  IOException
The recognizer entry method taking an InputSource.

Parameters:
input - InputSource to be parsed.
Throws:
IOException - on I/O error.
SAXException - propagated exception thrown by a DocumentHandler.
ParserConfigurationException - a parser satisfining requested configuration can not be created.
javax.xml.parsers.FactoryConfigurationRrror - if the implementation can not be instantiated.

parse

public void parse(URL url)
           throws SAXException,
                  ParserConfigurationException,
                  IOException
The recognizer entry method taking a URL.

Parameters:
url - URL source to be parsed.
Throws:
IOException - on I/O error.
SAXException - propagated exception thrown by a DocumentHandler.
ParserConfigurationException - a parser satisfining requested configuration can not be created.
javax.xml.parsers.FactoryConfigurationRrror - if the implementation can not be instantiated.

parse

public static void parse(InputSource input,
                         AidaHandler handler)
                  throws SAXException,
                         ParserConfigurationException,
                         IOException
The recognizer entry method taking an Inputsource.

Parameters:
input - InputSource to be parsed.
Throws:
IOException - on I/O error.
SAXException - propagated exception thrown by a DocumentHandler.
ParserConfigurationException - a parser satisfining requested configuration can not be created.
javax.xml.parsers.FactoryConfigurationRrror - if the implementation can not be instantiated.

parse

public static void parse(URL url,
                         AidaHandler handler)
                  throws SAXException,
                         ParserConfigurationException,
                         IOException
The recognizer entry method taking a URL.

Parameters:
url - URL source to be parsed.
Throws:
IOException - on I/O error.
SAXException - propagated exception thrown by a DocumentHandler.
ParserConfigurationException - a parser satisfining requested configuration can not be created.
javax.xml.parsers.FactoryConfigurationRrror - if the implementation can not be instantiated.

setValidate

public void setValidate(boolean validate)

getDefaultErrorHandler

protected ErrorHandler getDefaultErrorHandler()
Creates default error handler used by this parser.

Returns:
org.xml.sax.ErrorHandler implementation

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.