org.apache.excalibur.xml.impl
Class JaxpParser

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.excalibur.xml.impl.JaxpParser
All Implemented Interfaces:
Component, Disposable, DOMParser, org.xml.sax.ErrorHandler, LogEnabled, Parameterizable, Poolable, SAXParser, Serviceable

public final class JaxpParser
extends AbstractLogEnabled
implements SAXParser, DOMParser, Poolable, Component, Parameterizable, Serviceable, Disposable, org.xml.sax.ErrorHandler

An XMLParser that is only dependant on JAXP 1.1 compliant parsers. The configuration can contain the following parameters :

Version:
CVS $Revision: 1.7 $ $Date: 2004/03/28 18:56:45 $
Author:
Avalon Development Team

Field Summary
 
Fields inherited from interface org.apache.excalibur.xml.sax.SAXParser
ROLE
 
Fields inherited from interface org.apache.excalibur.xml.dom.DOMParser
ROLE
 
Constructor Summary
JaxpParser()
           
 
Method Summary
 org.w3c.dom.Document createDocument()
          Return a new Document.
 void dispose()
          The dispose operation is called at the end of a components lifecycle.
 void error(org.xml.sax.SAXParseException spe)
          Receive notification of a recoverable error.
 void fatalError(org.xml.sax.SAXParseException spe)
          Receive notification of a fatal error.
 void parameterize(Parameters params)
          Provide component with parameters.
 void parse(org.xml.sax.InputSource in, org.xml.sax.ContentHandler consumer)
          Parse the InputSource and send SAX events to the consumer.
 void parse(org.xml.sax.InputSource in, org.xml.sax.ContentHandler contentHandler, org.xml.sax.ext.LexicalHandler lexicalHandler)
          Parse the InputSource and send SAX events to the consumer.
 org.w3c.dom.Document parseDocument(org.xml.sax.InputSource input)
          Parses a new Document object from the given InputSource.
 void service(ServiceManager manager)
          Get the Entity Resolver from the component m_manager
 void warning(org.xml.sax.SAXParseException spe)
          Receive notification of a warning.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaxpParser

public JaxpParser()
Method Detail

service

public void service(ServiceManager manager)
             throws ServiceException
Get the Entity Resolver from the component m_manager

Specified by:
service in interface Serviceable
Parameters:
manager - The ServiceManager which this Serviceable uses. Must not be null.
Throws:
ServiceException - if an error occurs

dispose

public void dispose()
Description copied from interface: Disposable
The dispose operation is called at the end of a components lifecycle. This method will be called after Startable.stop() method (if implemented by component). Components use this method to release and destroy any resources that the Component owns.

Specified by:
dispose in interface Disposable

parameterize

public void parameterize(Parameters params)
                  throws ParameterException
Description copied from interface: Parameterizable
Provide component with parameters.

Specified by:
parameterize in interface Parameterizable
Parameters:
params - the parameters. Must not be null.
Throws:
ParameterException - if parameters are invalid

parse

public void parse(org.xml.sax.InputSource in,
                  org.xml.sax.ContentHandler contentHandler,
                  org.xml.sax.ext.LexicalHandler lexicalHandler)
           throws org.xml.sax.SAXException,
                  java.io.IOException
Parse the InputSource and send SAX events to the consumer. Attention: the consumer can implement the LexicalHandler as well. The parse should take care of this.

Specified by:
parse in interface SAXParser
Throws:
org.xml.sax.SAXException
java.io.IOException

parse

public void parse(org.xml.sax.InputSource in,
                  org.xml.sax.ContentHandler consumer)
           throws org.xml.sax.SAXException,
                  java.io.IOException
Parse the InputSource and send SAX events to the consumer. Attention: the consumer can implement the LexicalHandler as well. The parse should take care of this.

Specified by:
parse in interface SAXParser
Throws:
org.xml.sax.SAXException
java.io.IOException

parseDocument

public org.w3c.dom.Document parseDocument(org.xml.sax.InputSource input)
                                   throws org.xml.sax.SAXException,
                                          java.io.IOException
Parses a new Document object from the given InputSource.

Specified by:
parseDocument in interface DOMParser
Throws:
org.xml.sax.SAXException
java.io.IOException

createDocument

public org.w3c.dom.Document createDocument()
                                    throws org.xml.sax.SAXException
Return a new Document.

Specified by:
createDocument in interface DOMParser
Throws:
org.xml.sax.SAXException

error

public void error(org.xml.sax.SAXParseException spe)
           throws org.xml.sax.SAXException
Receive notification of a recoverable error.

Specified by:
error in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

fatalError

public void fatalError(org.xml.sax.SAXParseException spe)
                throws org.xml.sax.SAXException
Receive notification of a fatal error.

Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

warning

public void warning(org.xml.sax.SAXParseException spe)
             throws org.xml.sax.SAXException
Receive notification of a warning.

Specified by:
warning in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.