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

java.lang.Object
  extended by org.apache.excalibur.source.impl.AbstractSource
      extended by org.apache.cocoon.components.source.impl.ModuleSource
All Implemented Interfaces:
Source

public class ModuleSource
extends AbstractSource

A Source that takes its content from a module.

The URI syntax is "module::[#XPath]", where :

Author:
Daniel Fagerstom

Constructor Summary
ModuleSource(Map objectModel, String uri, ServiceManager manager, Logger logger)
          Create a module source from a 'module:' uri and a the object model.
 
Method Summary
 boolean exists()
          Does this source actually exist ?
 InputStream getInputStream()
          Return an InputStream object to read from the source.
 
Methods inherited from class org.apache.excalibur.source.impl.AbstractSource
checkInfos, getContentLength, getInfos, getLastModified, getMimeType, getScheme, getURI, getValidity, refresh, setContentLength, setLastModified, setScheme, setSystemId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleSource

public ModuleSource(Map objectModel,
                    String uri,
                    ServiceManager manager,
                    Logger logger)
             throws MalformedURLException
Create a module source from a 'module:' uri and a the object model.

The uri is of the form "module:attribute-type:attribute-name#xpath

Throws:
MalformedURLException
Method Detail

getInputStream

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

Specified by:
getInputStream in interface Source
Overrides:
getInputStream in class AbstractSource
Throws:
IOException - if I/O error occured.
SourceException

exists

public boolean exists()
Does this source actually exist ?

Returns:
true if the resource exists.


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