|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.components.source.AbstractStreamSource
public abstract class AbstractStreamSource
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 | |
---|---|
protected ComponentManager |
manager
Deprecated. The ComponentManager needed for streaming |
static TransformerFactory |
transformerFactory
Deprecated. The TrAX factory for serializing xml |
Constructor Summary | |
---|---|
protected |
AbstractStreamSource(ComponentManager manager)
Deprecated. Construct a new object |
Method Summary | |
---|---|
boolean |
exists()
Deprecated. Returns true if getInputStream() succeeds. |
long |
getContentLength()
Deprecated. Override this method to set the Content Length |
InputSource |
getInputSource()
Deprecated. Return a new InputSource object |
long |
getLastModified()
Deprecated. Override this method to set the Last Modification date |
protected boolean |
isHTMLContent()
Deprecated. Does this source contain HTML ? |
void |
recycle()
Deprecated. To be overriden in concrete subclasses if needed. |
void |
refresh()
Deprecated. To be overriden in concrete subclasses if needed. |
void |
toSAX(ContentHandler handler)
Deprecated. Stream content to a content handler or to an XMLConsumer. |
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.apache.cocoon.environment.Source |
---|
getInputStream, getSystemId |
Field Detail |
---|
public static TransformerFactory transformerFactory
protected ComponentManager manager
Constructor Detail |
---|
protected AbstractStreamSource(ComponentManager manager)
Method Detail |
---|
protected boolean isHTMLContent()
The default here is to return false. Concrete subclasses should override this if needed.
public InputSource getInputSource() throws IOException, ProcessingException
InputSource
object
getInputSource
in interface Source
InputSource
value
IOException
- if an error occurs
ProcessingException
- if an error occurspublic void toSAX(ContentHandler handler) throws SAXException
toSAX
in interface XMLizable
SAXException
- if failed to parse source document.public long getContentLength()
getContentLength
in interface Source
public long getLastModified()
getLastModified
in interface Source
public boolean exists()
true
if getInputStream()
succeeds.
Subclasses can provide a more efficient implementation.
public void recycle()
recycle
in interface Recyclable
public void refresh()
refresh
in interface ModifiableSource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |