com.ail.core.factory
Class XSLTFactory

java.lang.Object
  extended by com.ail.core.factory.AbstractFactory
      extended by com.ail.core.factory.XSLTFactory

public class XSLTFactory
extends AbstractFactory

Base a type definition on an XSTL. The XSLT must output a type definition that the CastorXMLFactory can consume. The factory may optionally take an instance of another type (derived from another type definition) as input using the 'extends' parameter.

For example: in the configuration sample below "OtherVersion" defines an instance of com.ail.core.Version and sets the source, state, date, etc properties on the instance. The NewVersion type is basd on OtherVersion (see the "extends" parameter) and overrides the setting of the 'source' property. So an instance created by NewVersion will contain all of the property settings defined in OtherVersion, but will have 'source' set to "orange and pineapple" rather than "Peach and mint".

 <type name="OtherVersion" builder="CastorBuilder" key="com.ail.core.Version">
   <patameter name="script"><![CDATA[
     <?xml version="1.0" encoding="UTF-8"?>
     <version serialVersion='0' lock='false' xsi:type='java:com.ail.core.Version' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" +
       <source>Peach and mint</source>
       <state>state</state>
       <date>14/10/2002</date>
       <author>T.S.Elliot</author>
       <comment>The loganberry's are sweet</comment>
       <copyright>Copyright us.</copyright>
       <version>1.0</version>
     </version>
   ]]></parameter>
 </type>

 <type name="NewVersion" builder="XSLTBuilder" key="com.ail.core.Version">
   <parameter name="extends">OtherVersion</parameter>
   <patameter name="script"><![CDATA[
      <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
      <xsl:output encoding="UTF-8" indent="no" method="xml" version="1.0"/>

        <xsl:template match='/'>
          <xsl:apply-templates/>
        </xsl:template>

        <xsl:template match='@*|*'>
          <xsl:copy>
            <xsl:apply-templates select='@*|node()'/>
          </xsl:copy>
        </xsl:template>

        <xsl:template match='source/text()'>orange and pineapple</xsl:template>
      </xsl:stylesheet>
 
   ]]></parameter>
 </type>
 

Author:
randerson

Constructor Summary
XSLTFactory()
           
 
Method Summary
 
Methods inherited from class com.ail.core.factory.AbstractFactory
createType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSLTFactory

public XSLTFactory()