net.sourceforge.chaperon.cocoon
Class TextGenerator

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.xml.AbstractXMLProducer
          extended byorg.apache.cocoon.generation.AbstractGenerator
              extended byorg.apache.cocoon.generation.ServiceableGenerator
                  extended bynet.sourceforge.chaperon.cocoon.TextGenerator
All Implemented Interfaces:
org.apache.cocoon.caching.CacheableProcessingComponent, org.apache.avalon.framework.activity.Disposable, org.apache.cocoon.generation.Generator, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.parameters.Parameterizable, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.avalon.framework.service.Serviceable, org.apache.cocoon.sitemap.SitemapModelComponent, org.apache.cocoon.xml.XMLProducer

public class TextGenerator
extends org.apache.cocoon.generation.ServiceableGenerator
implements org.apache.avalon.framework.parameters.Parameterizable, org.apache.cocoon.caching.CacheableProcessingComponent

Read a plain text file and produce a valid XML file.

 <text xmlns="http://chaperon.sourceforge.net/schema/text/1.0">
  Text 123 bla
 </text>
 

Version:
CVS $Id: TextGenerator.java,v 1.5 2004/01/18 01:36:29 benedikta Exp $
Author:
Stephan Michels , Rolf Schumacher

Field Summary
static java.lang.String URI
          The URI of the text element
 
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator
manager
 
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.generation.Generator
ROLE
 
Constructor Summary
TextGenerator()
           
 
Method Summary
 void generate()
          Generate XML data.
 java.io.Serializable getKey()
          Generate the unique key.
 org.apache.excalibur.source.SourceValidity getValidity()
          Generate the validity object.
 void parameterize(org.apache.avalon.framework.parameters.Parameters parameters)
          Provide component with parameters.
 void recycle()
          Recycle this component.
 void setup(org.apache.cocoon.environment.SourceResolver resolver, java.util.Map objectmodel, java.lang.String src, org.apache.avalon.framework.parameters.Parameters parameters)
          Set the SourceResolver, objectModel Map, the source and sitemap Parameters used to process the request.
 
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
dispose, service
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
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.xml.XMLProducer
setConsumer
 

Field Detail

URI

public static final java.lang.String URI
The URI of the text element

See Also:
Constant Field Values
Constructor Detail

TextGenerator

public TextGenerator()
Method Detail

recycle

public void recycle()
Recycle this component. All instance variables are set to null.

Specified by:
recycle in interface org.apache.avalon.excalibur.pool.Recyclable

parameterize

public void parameterize(org.apache.avalon.framework.parameters.Parameters parameters)
                  throws org.apache.avalon.framework.parameters.ParameterException
Provide component with parameters.

Specified by:
parameterize in interface org.apache.avalon.framework.parameters.Parameterizable
Parameters:
parameters - the parameters
Throws:
org.apache.avalon.framework.parameters.ParameterException - if parameters are invalid

setup

public void setup(org.apache.cocoon.environment.SourceResolver resolver,
                  java.util.Map objectmodel,
                  java.lang.String src,
                  org.apache.avalon.framework.parameters.Parameters parameters)
           throws org.apache.cocoon.ProcessingException,
                  org.xml.sax.SAXException,
                  java.io.IOException
Set the SourceResolver, objectModel Map, the source and sitemap Parameters used to process the request.

Specified by:
setup in interface org.apache.cocoon.sitemap.SitemapModelComponent
Parameters:
resolver - Source resolver
objectmodel - Object model
src - Source
parameters - Parameters
Throws:
java.io.IOException
org.apache.cocoon.ProcessingException
org.xml.sax.SAXException

getKey

public java.io.Serializable getKey()
Generate the unique key. This key must be unique inside the space of this component.

Specified by:
getKey in interface org.apache.cocoon.caching.CacheableProcessingComponent
Returns:
The generated key hashes the src

getValidity

public org.apache.excalibur.source.SourceValidity getValidity()
Generate the validity object.

Specified by:
getValidity in interface org.apache.cocoon.caching.CacheableProcessingComponent
Returns:
The generated validity object or null if the component is currently not cacheable.

generate

public void generate()
              throws java.io.IOException,
                     org.xml.sax.SAXException,
                     org.apache.cocoon.ProcessingException
Generate XML data.

Specified by:
generate in interface org.apache.cocoon.generation.Generator
Throws:
java.io.IOException
org.apache.cocoon.ProcessingException
org.xml.sax.SAXException


Copyright ? 2003 Chaperon project. All Rights Reserved.