org.apache.cocoon.serialization
Class SVGSerializer

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--org.apache.batik.dom.util.SAXDocumentFactory
              |
              +--org.apache.batik.dom.svg.SAXSVGDocumentFactory
                    |
                    +--org.apache.cocoon.xml.dom.SVGBuilder
                          |
                          +--org.apache.cocoon.serialization.SVGSerializer
All Implemented Interfaces:
Cacheable, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.xml.sax.ContentHandler, org.apache.avalon.framework.context.Contextualizable, org.apache.batik.dom.util.DocumentFactory, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.excalibur.pool.Poolable, Serializer, SitemapOutputComponent, org.apache.batik.dom.svg.SVGDocumentFactory, XMLConsumer

public class SVGSerializer
extends SVGBuilder
implements org.apache.avalon.framework.component.Composable, Serializer, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.excalibur.pool.Poolable, Cacheable, org.apache.avalon.framework.context.Contextualizable

A Batik based Serializer for generating PNG/JPEG images

Version:
CVS $Id: SVGSerializer.java,v 1.5.2.1 2002/06/05 00:42:21 vgritsenko Exp $
Author:
Davanum Srinivas, Ross Burton

Fields inherited from class org.apache.cocoon.xml.dom.SVGBuilder
log
 
Fields inherited from class org.apache.batik.dom.svg.SAXSVGDocumentFactory
dtdids, DTDIDS, HTTP_CHARSET
 
Fields inherited from class org.apache.batik.dom.util.SAXDocumentFactory
createDocumentDescriptor, currentNode, document, documentDescriptor, documentElementParsed, errorHandler, implementation, inCDATA, inDTD, isValidating, locator, namespaces, parserClassName
 
Fields inherited from interface org.apache.cocoon.serialization.Serializer
ROLE
 
Constructor Summary
SVGSerializer()
           
 
Method Summary
 void compose(org.apache.avalon.framework.component.ComponentManager manager)
          Set the current ComponentManager instance used by this Composable.
 void configure(org.apache.avalon.framework.configuration.Configuration conf)
          Set the configurations for this serializer.
 void contextualize(org.apache.avalon.framework.context.Context context)
          Get the context
 long generateKey()
          Generate the unique key.
 CacheValidity generateValidity()
          Generate the validity object.
 java.lang.String getMimeType()
          Return the MIME type.
 void notify(org.w3c.dom.Document doc)
          Receive notification of a successfully completed DOM tree generation.
 void setConsumer(XMLConsumer consumer)
          Set the XMLConsumer that will receive XML data.
 void setContentHandler(org.xml.sax.ContentHandler content)
          Set the ContentHandler that will receive XML data.
 void setLexicalHandler(org.xml.sax.ext.LexicalHandler lexical)
          Set the LexicalHandler that will receive XML data.
 void setOutputStream(java.io.OutputStream out)
          Set the OutputStream where the XML should be serialized.
 boolean shouldSetContentLength()
          Test if the component wants to set the content length
 
Methods inherited from class org.apache.cocoon.xml.dom.SVGBuilder
endDocument, getDocument, setLogger, startDocument
 
Methods inherited from class org.apache.batik.dom.svg.SAXSVGDocumentFactory
createDocument, createDocument, createDocument, createDocument, createDocument, createDocument, resolveEntity
 
Methods inherited from class org.apache.batik.dom.util.SAXDocumentFactory
characters, comment, createDocument, endCDATA, endDTD, endElement, endEntity, error, getDocumentDescriptor, isValidating, processingInstruction, setDocumentLocator, setErrorHandler, setValidating, startCDATA, startDTD, startElement, startEntity, warning
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, skippedEntity, startPrefixMapping, unparsedEntityDecl
 
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
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
 
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
 
Methods inherited from interface org.apache.batik.dom.util.DocumentFactory
getDocumentDescriptor, isValidating, setValidating
 

Constructor Detail

SVGSerializer

public SVGSerializer()
Method Detail

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Get the context
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable

setOutputStream

public void setOutputStream(java.io.OutputStream out)
Set the OutputStream where the XML should be serialized.
Specified by:
setOutputStream in interface SitemapOutputComponent

configure

public void configure(org.apache.avalon.framework.configuration.Configuration conf)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Set the configurations for this serializer.
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable

compose

public void compose(org.apache.avalon.framework.component.ComponentManager manager)
Set the current ComponentManager instance used by this Composable.
Specified by:
compose in interface org.apache.avalon.framework.component.Composable

setConsumer

public void setConsumer(XMLConsumer consumer)
Set the XMLConsumer that will receive XML data.
This method will simply call setContentHandler(consumer) and setLexicalHandler(consumer).

setContentHandler

public void setContentHandler(org.xml.sax.ContentHandler content)
Set the ContentHandler that will receive XML data.
Subclasses may retrieve this ContentHandler instance accessing the protected super.contentHandler field.

setLexicalHandler

public void setLexicalHandler(org.xml.sax.ext.LexicalHandler lexical)
Set the LexicalHandler that will receive XML data.
Subclasses may retrieve this LexicalHandler instance accessing the protected super.lexicalHandler field.
Throws:
java.lang.IllegalStateException - If the LexicalHandler or the XMLConsumer were already set.

notify

public void notify(org.w3c.dom.Document doc)
            throws org.xml.sax.SAXException
Receive notification of a successfully completed DOM tree generation.
Overrides:
notify in class SVGBuilder

getMimeType

public java.lang.String getMimeType()
Return the MIME type.
Specified by:
getMimeType in interface SitemapOutputComponent

generateKey

public long generateKey()
Generate the unique key. This key must be unique inside the space of this component. This method must be invoked before the generateValidity() method.
Specified by:
generateKey in interface Cacheable
Returns:
The generated key or 0 if the component is currently not cacheable.

generateValidity

public CacheValidity generateValidity()
Generate the validity object. Before this method can be invoked the generateKey() method must be invoked.
Specified by:
generateValidity in interface Cacheable
Returns:
The generated validity object or null if the component is currently not cacheable.

shouldSetContentLength

public boolean shouldSetContentLength()
Test if the component wants to set the content length
Specified by:
shouldSetContentLength in interface SitemapOutputComponent


Copyright � 1999-2002 Apache Software Foundation. All Rights Reserved.