org.apache.cocoon.serialization
Class TextSerializer

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.xml.AbstractXMLProducer
          extended byorg.apache.cocoon.xml.AbstractXMLPipe
              extended byorg.apache.cocoon.serialization.AbstractSerializer
                  extended byorg.apache.cocoon.serialization.AbstractTextSerializer
                      extended byorg.apache.cocoon.serialization.TextSerializer
All Implemented Interfaces:
org.apache.cocoon.caching.CacheableProcessingComponent, Configurable, ContentHandler, LexicalHandler, Poolable, Recyclable, org.apache.cocoon.serialization.Serializer, Serviceable, org.apache.cocoon.sitemap.SitemapOutputComponent, org.apache.cocoon.xml.XMLConsumer, XMLConsumer, org.apache.cocoon.xml.XMLPipe, org.apache.cocoon.xml.XMLProducer

public class TextSerializer
extends org.apache.cocoon.serialization.AbstractTextSerializer

Text serializer converts XML into plain text. It omits all XML tags and writes only character events to the output.

Internally, text serializer uses XML serializer with OutputKeys.METHOD set to text.

Input document must have at least one element - root element - which should wrap all the text inside it.

Version:
$Id: TextSerializer.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Nested Class Summary
 
Nested classes inherited from class org.apache.cocoon.serialization.AbstractTextSerializer
org.apache.cocoon.serialization.AbstractTextSerializer.NamespaceAsAttributes
 
Field Summary
 
Fields inherited from class org.apache.cocoon.serialization.AbstractTextSerializer
format
 
Fields inherited from class org.apache.cocoon.serialization.AbstractSerializer
output
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.serialization.Serializer
ROLE
 
Constructor Summary
TextSerializer()
           
 
Method Summary
 void characters(char[] c, int start, int len)
           
 void configure(Configuration conf)
          Set the configurations for this serializer.
 void endDocument()
           
 void init()
           
 void recycle()
           
 void setOutputStream(OutputStream out)
          Set the OutputStream where the requested resource should be serialized.
 void startElement(String uri, String loc, String raw, Attributes a)
           
 
Methods inherited from class org.apache.cocoon.serialization.AbstractTextSerializer
createCachingKey, getKey, getTransformerFactory, getTransformerHandler, getValidity, needsNamespacesAsAttributes, service, setConsumer, setContentHandler, setDefaultEncoding, setFormat, setLexicalHandler, setTransformerFactory
 
Methods inherited from class org.apache.cocoon.serialization.AbstractSerializer
getMimeType, shouldSetContentLength
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe
comment, endCDATA, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
 
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
 

Constructor Detail

TextSerializer

public TextSerializer()
Method Detail

init

public void init()
          throws Exception
Throws:
Exception

configure

public void configure(Configuration conf)
               throws ConfigurationException
Set the configurations for this serializer.

Throws:
ConfigurationException

setOutputStream

public void setOutputStream(OutputStream out)
                     throws IOException
Set the OutputStream where the requested resource should be serialized.

Throws:
IOException

startElement

public void startElement(String uri,
                         String loc,
                         String raw,
                         Attributes a)
                  throws SAXException
Throws:
SAXException

characters

public void characters(char[] c,
                       int start,
                       int len)
                throws SAXException
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
Throws:
SAXException

recycle

public void recycle()


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.