org.apache.cocoon.components.source.impl
Class AvalonToCocoonSource

java.lang.Object
  extended by org.apache.cocoon.components.source.impl.AvalonToCocoonSource
All Implemented Interfaces:
Poolable, Recyclable, ModifiableSource, Source, XMLizable

public final class AvalonToCocoonSource
extends Object
implements ModifiableSource

This source objects wraps an Avalon Excalibur Source to get an obsolete Cocoon Source object for the use of the deprecated SourceResolver.resolve(String) method.

Version:
CVS $Id: AvalonToCocoonSource.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler

Field Summary
protected  Environment environment
          The environment
protected  ComponentManager manager
          The manager
protected  SourceResolver resolver
          The source resolver
protected  Source source
          The real source
 
Constructor Summary
AvalonToCocoonSource(Source source, SourceResolver resolver, Environment environment, ComponentManager manager)
          Constructor
 
Method Summary
 long getContentLength()
          Get the content length of the source or -1 if it is not possible to determine the length.
 InputSource getInputSource()
          Return an InputSource object to read the XML content.
 InputStream getInputStream()
          Return an InputStream object to read from the source.
 long getLastModified()
          Get the last modification date of the source or 0 if it is not possible to determine the date.
 String getSystemId()
          Return the unique identifer for this source
 void recycle()
           
 void refresh()
          Refresh the content of this object after the underlying data content has changed.
 void toSAX(ContentHandler handler)
          Stream content to a content handler or to an XMLConsumer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected Source source
The real source


resolver

protected SourceResolver resolver
The source resolver


environment

protected Environment environment
The environment


manager

protected ComponentManager manager
The manager

Constructor Detail

AvalonToCocoonSource

public AvalonToCocoonSource(Source source,
                            SourceResolver resolver,
                            Environment environment,
                            ComponentManager manager)
Constructor

Method Detail

getLastModified

public long getLastModified()
Get the last modification date of the source or 0 if it is not possible to determine the date.

Specified by:
getLastModified in interface Source

getContentLength

public long getContentLength()
Get the content length of the source or -1 if it is not possible to determine the length.

Specified by:
getContentLength in interface Source

getInputStream

public InputStream getInputStream()
                           throws ProcessingException,
                                  IOException
Return an InputStream object to read from the source.

Specified by:
getInputStream in interface Source
Throws:
ProcessingException
IOException

getInputSource

public InputSource getInputSource()
                           throws ProcessingException,
                                  IOException
Return an InputSource object to read the XML content.

Specified by:
getInputSource in interface Source
Returns:
an InputSource value
Throws:
ProcessingException - if an error occurs
IOException - if an error occurs

getSystemId

public String getSystemId()
Return the unique identifer for this source

Specified by:
getSystemId in interface Source

recycle

public void recycle()
Specified by:
recycle in interface Recyclable

refresh

public void refresh()
Description copied from interface: ModifiableSource
Refresh the content of this object after the underlying data content has changed.

Specified by:
refresh in interface ModifiableSource

toSAX

public void toSAX(ContentHandler handler)
           throws SAXException
Stream content to a content handler or to an XMLConsumer.

Specified by:
toSAX in interface XMLizable
Throws:
SAXException - if failed to parse source document.


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