Save This Page
Home » cocoon-2.1.11-src » org.apache » cocoon » transformation » [javadoc | source]
org.apache.cocoon.transformation
public class: CastorTransformer [javadoc | source]
java.lang.Object
   org.apache.avalon.framework.logger.AbstractLogEnabled
      org.apache.cocoon.xml.AbstractXMLProducer
         org.apache.cocoon.xml.AbstractXMLPipe
            org.apache.cocoon.transformation.AbstractTransformer
               org.apache.cocoon.transformation.CastorTransformer

All Implemented Interfaces:
    org.apache.avalon.framework.configuration.Configurable, Transformer, XMLPipe, org.apache.avalon.excalibur.pool.Recyclable, XMLProducer

Description: Marshals a object from the Sitemap, Session, Request or the Conext into a series of SAX events Configuation: The Castortransformer need to be configured with a default mapping. This mapping is used as long as no other mapping is spezfied as the element
<map:transformer name="CastorTransformer" src="org.apache.cocoon.transformation.CastorTransformer">
<mapping>castor/xmapping.xml</mapping>
</map:transformer>
A sample for the use:
<root xmlns:castor="http://castor.exolab.org/cocoontransfomer">
<castor:InsertBean name="invoice"/>
<castor:InsertBean name="product" scope="sitemap" mapping="castor/specicalmapping.xml"/>
</root>
The CastorTransfomer support only one Element castor:InsertBean. This element is replaced with the marshalled object. The Object given through the attrbute name will be searched in the sitemap, request, session and at least in application If the scope is explicitly given, e.g , the object will ge located only here The Attribut mapping specifys the mapping to be used. If not given the default mapping is used
Author Thorsten Mauch








    







    
Field Summary
static final  String CMD_INSERT_BEAN     
static final  String ATTRIB_NAME     
static final  String ATTRIB_SCOPE     
static final  String VALUE_SITEMAP     
static final  String VALUE_SESSION     
static final  String VALUE_REQUEST     
static final  String VALUE_CONTEXT     
static final  String MAPPING_CONFIG     
Fields inherited from org.apache.cocoon.xml.AbstractXMLProducer:
EMPTY_CONTENT_HANDLER,  xmlConsumer,  contentHandler,  lexicalHandler
Constructor:
 public CastorTransformer() 
Method from org.apache.cocoon.transformation.CastorTransformer Summary:
characters,   configure,   endElement,   getFile,   setup,   startElement
Methods from org.apache.cocoon.xml.AbstractXMLPipe:
characters,   comment,   endCDATA,   endDTD,   endDocument,   endElement,   endEntity,   endPrefixMapping,   ignorableWhitespace,   processingInstruction,   setDocumentLocator,   skippedEntity,   startCDATA,   startDTD,   startDocument,   startElement,   startEntity,   startPrefixMapping
Methods from org.apache.cocoon.xml.AbstractXMLProducer:
recycle,   setConsumer,   setContentHandler,   setLexicalHandler
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.cocoon.transformation.CastorTransformer Detail:
 public  void characters(char[] ch,
    int start,
    int len) throws SAXException 
 public  void configure(Configuration conf) throws ConfigurationException 
 public  void endElement(String uri,
    String name,
    String raw) throws SAXException 
 public String getFile(SourceResolver sr,
    String FileName) 
 public  void setup(SourceResolver resolver,
    Map objectModel,
    String src,
    Parameters params) throws ProcessingException, IOException, SAXException 
 public  void startElement(String uri,
    String name,
    String raw,
    Attributes attr) throws SAXException