Save This Page
Home » cocoon-2.1.11-src » org.apache » cocoon » components » source » [javadoc | source]
org.apache.cocoon.components.source
abstract public class: AbstractStreamSource [javadoc | source]
java.lang.Object
   org.apache.avalon.framework.logger.AbstractLogEnabled
      org.apache.cocoon.components.source.AbstractStreamSource

All Implemented Interfaces:
    ModifiableSource

Direct Known Subclasses:
    AbstractStreamWriteableSource, URLSource, BlobSource, FileSource

Deprecated! Use - the new Avalon Excalibur Source Resolving

This abstract class provides convenience methods to implement a stream based Source. Implement getInputStream(), getSystemId() and optionally override refresh(), recycle(), getLastModified() and getContentLength() to obtain a valid Source implementation.

This base implementation provides services to parse HTML sources (HTML is not valid XML) using JTidy, if present. The source is considered to contain HTML if isHTMLContent() returns true.

Field Summary
public static  TransformerFactory transformerFactory    The TrAX factory for serializing xml 
protected  ComponentManager manager    The ComponentManager needed for streaming 
Constructor:
 protected AbstractStreamSource(ComponentManager manager) 
    Construct a new object
Method from org.apache.cocoon.components.source.AbstractStreamSource Summary:
exists,   getContentLength,   getInputSource,   getLastModified,   isHTMLContent,   recycle,   refresh,   toSAX
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.cocoon.components.source.AbstractStreamSource Detail:
 public boolean exists() 
      Deprecated!
    Returns true if getInputStream() succeeds. Subclasses can provide a more efficient implementation.
 public long getContentLength() 
      Deprecated!
    Override this method to set the Content Length
 public InputSource getInputSource() throws IOException, ProcessingException 
      Deprecated!
    Return a new InputSource object
 public long getLastModified() 
      Deprecated!
    Override this method to set the Last Modification date
 protected boolean isHTMLContent() 
      Deprecated!
    Does this source contain HTML ? If true, JTidy will be used (if available) to parse the input as XML.

    The default here is to return false. Concrete subclasses should override this if needed.

 public  void recycle() 
      Deprecated!
    To be overriden in concrete subclasses if needed.
 public  void refresh() 
      Deprecated!
    To be overriden in concrete subclasses if needed.
 public  void toSAX(ContentHandler handler) throws SAXException 
      Deprecated!
    Stream content to a content handler or to an XMLConsumer.