org.apache.cocoon.components.source
Class AbstractStreamWriteableSource
java.lang.Object
|
+--org.apache.avalon.framework.logger.AbstractLoggable
|
+--org.apache.cocoon.components.source.AbstractStreamSource
|
+--org.apache.cocoon.components.source.AbstractStreamWriteableSource
- All Implemented Interfaces:
- org.apache.avalon.framework.logger.Loggable, ModifiableSource, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, Source, WriteableSource, XMLizable
- Direct Known Subclasses:
- FileSource
- public abstract class AbstractStreamWriteableSource
- extends AbstractStreamSource
- implements WriteableSource
This abstract class provides convenience methods to implement
a stream based WriteableSource
. Implement getOutputStream()
to obtain a valid implementation.
This base implementation creates a ContentHandler
by using
the sitemap 'xml' serializer to write SAX events to the stream returned by
getOutputStream()
.
- Version:
- $Id: AbstractStreamWriteableSource.java,v 1.2 2002/02/28 18:00:50 sylvain Exp $
- Author:
- Sylvain Wallez
Method Summary |
boolean |
canCancel(org.xml.sax.ContentHandler handler)
Checks if the OutputStream under handler can be cancelled. |
boolean |
canCancel(java.io.OutputStream stream)
Always return false . |
void |
cancel(org.xml.sax.ContentHandler handler)
Cancels the OutputStream under handler . |
void |
cancel(java.io.OutputStream stream)
Always throw UnsupportedOperationException . |
org.xml.sax.ContentHandler |
getContentHandler()
Get a ContentHandler to write a SAX stream to this source. |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable |
getLogger, setLogger, 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.apache.avalon.excalibur.pool.Recyclable |
recycle |
Methods inherited from interface org.apache.cocoon.xml.XMLizable |
toSAX |
AbstractStreamWriteableSource
protected AbstractStreamWriteableSource(org.apache.avalon.framework.component.ComponentManager manager)
canCancel
public boolean canCancel(org.xml.sax.ContentHandler handler)
- Checks if the
OutputStream
under handler
can be cancelled.
- Specified by:
canCancel
in interface WriteableSource
- See Also:
canCancel(OutputStream)
canCancel
public boolean canCancel(java.io.OutputStream stream)
- Always return
false
. To be redefined by implementations that support
cancel()
.
- Specified by:
canCancel
in interface WriteableSource
- Following copied from interface:
org.apache.cocoon.environment.WriteableSource
- Returns:
- true if the stream can be cancelled
cancel
public void cancel(org.xml.sax.ContentHandler handler)
throws java.lang.Exception
- Cancels the
OutputStream
under handler
.
- Specified by:
cancel
in interface WriteableSource
- See Also:
cancel(OutputStream)
cancel
public void cancel(java.io.OutputStream stream)
throws java.lang.Exception
- Always throw
UnsupportedOperationException
. To be redefined by
implementations that support cancel()
.
- Specified by:
cancel
in interface WriteableSource
getContentHandler
public org.xml.sax.ContentHandler getContentHandler()
throws org.xml.sax.SAXException,
ProcessingException
- Get a
ContentHandler
to write a SAX stream to this source. It
uses either the 'xml' or 'html' serializer depending on the result of
AbstractStreamSource.isHTMLContent()
to serialize events, and thus these serializers must
exist in this source's component manager.
- Specified by:
getContentHandler
in interface WriteableSource
- Following copied from interface:
org.apache.cocoon.environment.WriteableSource
- Returns:
- a handler for SAX events
Copyright � 1999-2002 Apache Software Foundation. All Rights Reserved.