org.apache.cocoon.xml
Interface XMLProducer

All Known Subinterfaces:
Generator, Transformer, XMLPipe

public interface XMLProducer

This interfaces identifies classes that produce XML data, sending SAX events to the configured XMLConsumer.

The XMLProducer is comprised of only one method to give the component the next element of the pipeline. Cocoon calls the setConsumer() method with the reference to the next XMLConsumer in the pipeline. The approach allows the XMLProducer to call the different SAX related methods on the XMLConsumer without knowing ahead of time what that consumer will be. The design is very simple and very powerful in that it allows Cocoon to daisy chain several components in any order and then execute the pipeline.

Any producer can be paired with any consumer and we have a pipeline. The core design is very powerful and allows the end user to mix and match sitemap components as they see fit. Cocoon will always call setConsumer() on every XMLProducer in a pipeline or it will throw an exception saying that the pipeline is invalid (i.e. there is no serializer for the pipeline). The only contract that the XMLProducer has to worry about is that it must always make calls to the XMLConsumer passed in through the setConsumer() method.

Version:
$Id: XMLProducer.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Method Summary
 void setConsumer(XMLConsumer consumer)
          Set the XMLConsumer that will receive XML data.
 

Method Detail

setConsumer

public void setConsumer(XMLConsumer consumer)
Set the XMLConsumer that will receive XML data.

Parameters:
consumer - The XMLConsumer target for SAX events.


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