org.apache.cocoon.xml
Class AbstractXMLProducer

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.xml.AbstractXMLProducer
All Implemented Interfaces:
Poolable, Recyclable, LogEnabled, XMLProducer
Direct Known Subclasses:
AbstractGenerator, AbstractXMLPipe, DocumentHandlerAdapter, DOMStreamer.DefaultDOMStreamer, DOMStreamer.NamespaceNormalizingDOMStreamer, JaxpParser, TagTransformer, XercesParser

public abstract class AbstractXMLProducer
extends AbstractLogEnabled
implements XMLProducer, Recyclable

This abstract class provides default implementation of the methods specified by the XMLProducer interface.

Version:
CVS $Id: AbstractXMLProducer.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Pierpaolo Fumagalli (Apache Software Foundation)

Field Summary
protected  ContentHandler contentHandler
          The ContentHandler receiving SAX events.
protected static ContentHandler EMPTY_CONTENT_HANDLER
           
protected  LexicalHandler lexicalHandler
          The LexicalHandler receiving SAX events.
protected  XMLConsumer xmlConsumer
          The XMLConsumer receiving SAX events.
 
Constructor Summary
AbstractXMLProducer()
           
 
Method Summary
 void recycle()
          Recycle the producer by removing references, and resetting handlers to null (empty) implementations.
 void setConsumer(XMLConsumer consumer)
          Set the XMLConsumer that will receive XML data.
 void setContentHandler(ContentHandler handler)
          Set the ContentHandler that will receive XML data.
 void setLexicalHandler(LexicalHandler handler)
          Set the LexicalHandler that will receive XML data.
 
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
 

Field Detail

EMPTY_CONTENT_HANDLER

protected static final ContentHandler EMPTY_CONTENT_HANDLER

xmlConsumer

protected XMLConsumer xmlConsumer
The XMLConsumer receiving SAX events.


contentHandler

protected ContentHandler contentHandler
The ContentHandler receiving SAX events.


lexicalHandler

protected LexicalHandler lexicalHandler
The LexicalHandler receiving SAX events.

Constructor Detail

AbstractXMLProducer

public AbstractXMLProducer()
Method Detail

setConsumer

public void setConsumer(XMLConsumer consumer)
Set the XMLConsumer that will receive XML data.
This method will simply call setContentHandler(consumer) and setLexicalHandler(consumer).

Specified by:
setConsumer in interface XMLProducer

setContentHandler

public void setContentHandler(ContentHandler handler)
Set the ContentHandler that will receive XML data.
Subclasses may retrieve this ContentHandler instance accessing the protected super.contentHandler field.


setLexicalHandler

public void setLexicalHandler(LexicalHandler handler)
Set the LexicalHandler that will receive XML data.
Subclasses may retrieve this LexicalHandler instance accessing the protected super.lexicalHandler field.


recycle

public void recycle()
Recycle the producer by removing references, and resetting handlers to null (empty) implementations.

Specified by:
recycle in interface Recyclable


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.