org.apache.velocity.tools.config
Class XmlFactoryConfigurationRuleSet

java.lang.Object
  extended by org.apache.commons.digester.RuleSetBase
      extended by org.apache.velocity.tools.config.XmlFactoryConfigurationRuleSet
All Implemented Interfaces:
org.apache.commons.digester.RuleSet

public class XmlFactoryConfigurationRuleSet
extends org.apache.commons.digester.RuleSetBase

This provides set of XmlFactoryConfigurationRuleSet.DataValueInBodyRules used by Commons-Digester to process configuration info formatted as XML. This is the default RuleSet used by XmlFactoryConfiguration.

Here is a short example XML:


 <tools> 
     <data type="number" key="version" value="1.1"/>
     <data key="isConvertedProp" value="false" class="java.lang.Boolean" converter="org.apache.commons.beanutils.converters.BooleanConverter"/>
     <data type="boolean" key="isKnownType" value="true"/>
     <data key="isAutoType" value="true"/>
     <data key="foo" value="this is foo."/>
     <data key="bar">this is bar.</data>
     <toolbox scope="request" xhtml="true">
         <tool key="toytool" class="ToyTool" restrictTo="index.vm"/>
     </toolbox>
     <toolbox scope="session">
         <property name="createSession" value="true" type="boolean"/>
         <tool key="map" class="java.util.HashMap"/>
     </toolbox>
     <toolbox scope="application">
         <tool class="org.apache.velocity.tools.generic.DateTool"/>
     </toolbox>
 </tools>
 

Version:
$Id: XmlConfiguration.java 511959 2007-02-26 19:24:39Z nbubna $
Author:
Nathan Bubna

Nested Class Summary
static class XmlFactoryConfigurationRuleSet.DataValueInBodyRule
          Rule for adding configuration properties
static class XmlFactoryConfigurationRuleSet.PropertyAttributeRule
           
 
Field Summary
protected  Class dataClass
           
protected  Class propertyClass
           
protected  Class toolboxConfigurationClass
           
protected  Class toolConfigurationClass
           
 
Fields inherited from class org.apache.commons.digester.RuleSetBase
namespaceURI
 
Constructor Summary
XmlFactoryConfigurationRuleSet()
           
 
Method Summary
 void addRuleInstances(org.apache.commons.digester.Digester digester)
          Add the set of Rule instances defined in this RuleSet to the specified Digester instance, associating them with our namespace URI (if any).
 void setDataClass(Class clazz)
           
 void setPropertyClass(Class clazz)
           
 void setToolboxConfigurationClass(Class clazz)
           
 void setToolConfigurationClass(Class clazz)
           
 
Methods inherited from class org.apache.commons.digester.RuleSetBase
getNamespaceURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

toolboxConfigurationClass

protected Class toolboxConfigurationClass

toolConfigurationClass

protected Class toolConfigurationClass

dataClass

protected Class dataClass

propertyClass

protected Class propertyClass
Constructor Detail

XmlFactoryConfigurationRuleSet

public XmlFactoryConfigurationRuleSet()
Method Detail

setToolboxConfigurationClass

public void setToolboxConfigurationClass(Class clazz)

setToolConfigurationClass

public void setToolConfigurationClass(Class clazz)

setDataClass

public void setDataClass(Class clazz)

setPropertyClass

public void setPropertyClass(Class clazz)

addRuleInstances

public void addRuleInstances(org.apache.commons.digester.Digester digester)

Add the set of Rule instances defined in this RuleSet to the specified Digester instance, associating them with our namespace URI (if any). This method should only be called by a Digester instance. These rules assume that an instance of org.apache.velocity.tools.view.ToolboxManager is pushed onto the evaluation stack before parsing begins.

Specified by:
addRuleInstances in interface org.apache.commons.digester.RuleSet
Specified by:
addRuleInstances in class org.apache.commons.digester.RuleSetBase
Parameters:
digester - Digester instance to which the new Rule instances should be added.


Copyright © 2002-2011 The Apache Software Foundation. All Rights Reserved.