org.apache.cocoon.transformation
Class XIncludeTransformer

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.xml.AbstractXMLProducer
          extended by org.apache.cocoon.xml.AbstractXMLPipe
              extended by org.apache.cocoon.transformation.AbstractTransformer
                  extended by org.apache.cocoon.transformation.XIncludeTransformer
All Implemented Interfaces:
Poolable, Recyclable, Component, LogEnabled, Serviceable, CacheableProcessingComponent, SitemapModelComponent, Transformer, XMLPipe, XMLProducer, XMLConsumer, ContentHandler, LexicalHandler

public class XIncludeTransformer
extends AbstractTransformer
implements Serviceable, CacheableProcessingComponent

Version:
SVN $Id: XIncludeTransformer.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Donald Ball (wrote the original version)

Field Summary
protected  ServiceManager manager
           
protected  SourceResolver resolver
           
protected  MultiSourceValidity validity
          The SourceValidity instance associated with this request.
static String XINCLUDE_FALLBACK_ELEMENT
           
static String XINCLUDE_INCLUDE_ELEMENT
           
static String XINCLUDE_INCLUDE_ELEMENT_HREF_ATTRIBUTE
           
static String XINCLUDE_INCLUDE_ELEMENT_PARSE_ATTRIBUTE
           
static String XINCLUDE_INCLUDE_ELEMENT_XPOINTER_ATTRIBUTE
           
static String XINCLUDE_NAMESPACE_URI
           
static String XMLBASE_ATTRIBUTE
           
static String XMLBASE_ATTRIBUTE_TYPE
           
static String XMLBASE_NAMESPACE_PREFIX
           
static String XMLBASE_NAMESPACE_URI
          Deprecated. Should be removed in cocoon 2.2. Use javax.xml.XMLConstants.XML_NS_URI instead.
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.transformation.Transformer
ROLE
 
Constructor Summary
XIncludeTransformer()
           
 
Method Summary
 Serializable getKey()
          Key to be used for caching
 SourceValidity getValidity()
          Get the validity for this transform
 void recycle()
          Recycle the producer by removing references, and resetting handlers to null (empty) implementations.
 void service(ServiceManager manager)
           
 void setConsumer(XMLConsumer consumer)
          Set the XMLConsumer that will receive XML data.
 void setContentHandler(ContentHandler handler)
          Set the ContentHandler that will receive XML data.
 void setLexicalHandler(LexicalHandler handler)
          Set the LexicalHandler that will receive XML data.
 void setup(SourceResolver resolver, Map objectModel, String source, Parameters parameters)
          Set the SourceResolver, objectModel Map, the source and sitemap Parameters used to process the request.
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping
 
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.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
 

Field Detail

resolver

protected SourceResolver resolver

manager

protected ServiceManager manager

XMLBASE_NAMESPACE_URI

public static final String XMLBASE_NAMESPACE_URI
Deprecated. Should be removed in cocoon 2.2. Use javax.xml.XMLConstants.XML_NS_URI instead.
See Also:
Constant Field Values

XMLBASE_NAMESPACE_PREFIX

public static final String XMLBASE_NAMESPACE_PREFIX
See Also:
Constant Field Values

XMLBASE_ATTRIBUTE

public static final String XMLBASE_ATTRIBUTE
See Also:
Constant Field Values

XMLBASE_ATTRIBUTE_TYPE

public static final String XMLBASE_ATTRIBUTE_TYPE
See Also:
Constant Field Values

XINCLUDE_NAMESPACE_URI

public static final String XINCLUDE_NAMESPACE_URI
See Also:
Constant Field Values

XINCLUDE_INCLUDE_ELEMENT

public static final String XINCLUDE_INCLUDE_ELEMENT
See Also:
Constant Field Values

XINCLUDE_FALLBACK_ELEMENT

public static final String XINCLUDE_FALLBACK_ELEMENT
See Also:
Constant Field Values

XINCLUDE_INCLUDE_ELEMENT_HREF_ATTRIBUTE

public static final String XINCLUDE_INCLUDE_ELEMENT_HREF_ATTRIBUTE
See Also:
Constant Field Values

XINCLUDE_INCLUDE_ELEMENT_XPOINTER_ATTRIBUTE

public static final String XINCLUDE_INCLUDE_ELEMENT_XPOINTER_ATTRIBUTE
See Also:
Constant Field Values

XINCLUDE_INCLUDE_ELEMENT_PARSE_ATTRIBUTE

public static final String XINCLUDE_INCLUDE_ELEMENT_PARSE_ATTRIBUTE
See Also:
Constant Field Values

validity

protected MultiSourceValidity validity
The SourceValidity instance associated with this request.

Constructor Detail

XIncludeTransformer

public XIncludeTransformer()
Method Detail

setup

public void setup(SourceResolver resolver,
                  Map objectModel,
                  String source,
                  Parameters parameters)
           throws ProcessingException,
                  SAXException,
                  IOException
Description copied from interface: SitemapModelComponent
Set the SourceResolver, objectModel Map, the source and sitemap Parameters used to process the request.

Specified by:
setup in interface SitemapModelComponent
Throws:
ProcessingException
SAXException
IOException

setConsumer

public void setConsumer(XMLConsumer consumer)
Description copied from class: AbstractXMLProducer
Set the XMLConsumer that will receive XML data.
This method will simply call setContentHandler(consumer) and setLexicalHandler(consumer).

Specified by:
setConsumer in interface XMLProducer
Overrides:
setConsumer in class AbstractXMLProducer

setContentHandler

public void setContentHandler(ContentHandler handler)
Description copied from class: AbstractXMLProducer
Set the ContentHandler that will receive XML data.
Subclasses may retrieve this ContentHandler instance accessing the protected super.contentHandler field.

Overrides:
setContentHandler in class AbstractXMLProducer

setLexicalHandler

public void setLexicalHandler(LexicalHandler handler)
Description copied from class: AbstractXMLProducer
Set the LexicalHandler that will receive XML data.
Subclasses may retrieve this LexicalHandler instance accessing the protected super.lexicalHandler field.

Overrides:
setLexicalHandler in class AbstractXMLProducer

service

public void service(ServiceManager manager)
Specified by:
service in interface Serviceable

getKey

public Serializable getKey()
Key to be used for caching

Specified by:
getKey in interface CacheableProcessingComponent
Returns:
The generated key or null if the component is currently not cacheable.

getValidity

public SourceValidity getValidity()
Get the validity for this transform

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

recycle

public void recycle()
Description copied from class: AbstractXMLProducer
Recycle the producer by removing references, and resetting handlers to null (empty) implementations.

Specified by:
recycle in interface Recyclable
Overrides:
recycle in class AbstractXMLProducer


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