org.apache.cocoon.environment
Interface WriteableSource

All Superinterfaces:
ModifiableSource, Poolable, Recyclable, Source, XMLizable
All Known Implementing Classes:
AbstractStreamWriteableSource, FileSource

Deprecated. Use the ModifiableSource interface instead

public interface WriteableSource
extends ModifiableSource

A Source that can be written to. It provides two methods that allow for SAX-based and byte-based output.

Callers will use the most appropriate method for their use and it's up to the implementation to handle both sources. For example, an XML-based implementation can use a parser to convert bytes written to the OutputStream to SAX events, and a byte-based implementation (such as file), can use a serializer to convert SAX events to a byte stream.

Version:
CVS $Id: WriteableSource.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Sylvain Wallez

Method Summary
 boolean canCancel(ContentHandler handler)
          Deprecated. Can the data sent to a ContentHandler returned by getContentHandler() be cancelled ?
 boolean canCancel(OutputStream stream)
          Deprecated. Can the data sent to an OutputStream returned by getOutputStream() be cancelled ?
 void cancel(ContentHandler handler)
          Deprecated. Cancel the data sent to a ContentHandler returned by getContentHandler().
 void cancel(OutputStream stream)
          Deprecated. Cancel the data sent to an OutputStream returned by getOutputStream().
 boolean exists()
          Deprecated. Does this source actually exist ?
 ContentHandler getContentHandler()
          Deprecated. Get a ContentHandler where an XML document can be written using SAX events.
 OutputStream getOutputStream()
          Deprecated. Get an InputStream where raw bytes can be written to.
 
Methods inherited from interface org.apache.cocoon.environment.ModifiableSource
refresh
 
Methods inherited from interface org.apache.cocoon.environment.Source
getContentLength, getInputSource, getInputStream, getLastModified, getSystemId
 
Methods inherited from interface org.apache.avalon.excalibur.pool.Recyclable
recycle
 
Methods inherited from interface org.apache.excalibur.xml.sax.XMLizable
toSAX
 

Method Detail

exists

boolean exists()
Deprecated. 
Does this source actually exist ?

Returns:
true if the resource exists.

getContentHandler

ContentHandler getContentHandler()
                                 throws SAXException,
                                        ProcessingException
Deprecated. 
Get a ContentHandler where an XML document can be written using SAX events.

Care should be taken that the returned handler can actually be a XMLConsumer supporting also lexical events such as comments.

Returns:
a handler for SAX events
Throws:
SAXException
ProcessingException

getOutputStream

OutputStream getOutputStream()
                             throws IOException,
                                    ProcessingException
Deprecated. 
Get an InputStream where raw bytes can be written to. The signification of these bytes is implementation-dependent and is not restricted to a serialized XML document.

Returns:
a stream to write to
Throws:
IOException
ProcessingException

canCancel

boolean canCancel(ContentHandler handler)
Deprecated. 
Can the data sent to a ContentHandler returned by getContentHandler() be cancelled ?

Returns:
true if the handler can be cancelled

canCancel

boolean canCancel(OutputStream stream)
Deprecated. 
Can the data sent to an OutputStream returned by getOutputStream() be cancelled ?

Returns:
true if the stream can be cancelled

cancel

void cancel(ContentHandler handler)
            throws Exception
Deprecated. 
Cancel the data sent to a ContentHandler returned by getContentHandler().

After cancel, the handler should no more be used.

Throws:
Exception

cancel

void cancel(OutputStream stream)
            throws Exception
Deprecated. 
Cancel the data sent to an OutputStream returned by getOutputStream().

After cancel, the stream should no more be used.

Throws:
Exception


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