org.apache.cocoon.serialization
Class AbstractSerializer

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.xml.AbstractXMLProducer
          extended byorg.apache.cocoon.xml.AbstractXMLPipe
              extended byorg.apache.cocoon.serialization.AbstractSerializer
All Implemented Interfaces:
ContentHandler, LexicalHandler, LogEnabled, Poolable, Recyclable, Serializer, SitemapOutputComponent, XMLConsumer, XMLConsumer, XMLPipe, XMLProducer
Direct Known Subclasses:
AbstractTextSerializer, FOPSerializer, iTextSerializer, XMidiSerializer, ZipArchiveSerializer

public abstract class AbstractSerializer
extends AbstractXMLPipe
implements Serializer

Version:
CVS $Id: AbstractSerializer.java 30941 2004-07-29 19:56:58Z vgritsenko $
Author:
Pierpaolo Fumagalli (Apache Software Foundation), Stefano Mazzocchi

Field Summary
protected  OutputStream output
          The OutputStream used by this serializer.
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.serialization.Serializer
ROLE
 
Constructor Summary
AbstractSerializer()
           
 
Method Summary
 String getMimeType()
          Get the mime-type of the output of this Serializer This default implementation returns null to indicate that the mime-type specified in the sitemap is to be used
 void recycle()
          Recycle serializer by removing references
 void setOutputStream(OutputStream out)
          Set the OutputStream where the requested resource should be serialized.
 boolean shouldSetContentLength()
          Test if the component wants to set the content length
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
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
 
Methods inherited from interface org.xml.sax.ContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
 
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

output

protected OutputStream output
The OutputStream used by this serializer.

Constructor Detail

AbstractSerializer

public AbstractSerializer()
Method Detail

setOutputStream

public void setOutputStream(OutputStream out)
                     throws IOException
Set the OutputStream where the requested resource should be serialized.

Specified by:
setOutputStream in interface SitemapOutputComponent
Parameters:
out - The OutputStream target for the rendered results.
Throws:
IOException - if the stream can't be used.

getMimeType

public String getMimeType()
Get the mime-type of the output of this Serializer This default implementation returns null to indicate that the mime-type specified in the sitemap is to be used

Specified by:
getMimeType in interface SitemapOutputComponent
Returns:
the mime-type for the results.

recycle

public void recycle()
Recycle serializer by removing references

Specified by:
recycle in interface Recyclable
Overrides:
recycle in class AbstractXMLProducer

shouldSetContentLength

public boolean shouldSetContentLength()
Test if the component wants to set the content length

Specified by:
shouldSetContentLength in interface SitemapOutputComponent
Returns:
true if the content length needs to be set.


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.