org.apache.velocity.tools.config

## Class XmlFactoryConfigurationRuleSet

- java.lang.Object
- - org.apache.commons.digester3.RuleSetBase
  - - org.apache.velocity.tools.config.XmlFactoryConfigurationRuleSet

All Implemented Interfaces:
  org.apache.commons.digester3.RuleSet

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

This provides set of `Rule`s 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

Nested Classes
`static class` `XmlFactoryConfigurationRuleSet.DataValueInBodyRule` Rule for adding configuration properties
`static class` `XmlFactoryConfigurationRuleSet.PropertyAttributeRule`

### Field Summary

Fields
`protected Class` `dataClass`
`protected Class` `propertyClass`
`protected Class` `toolboxConfigurationClass`
`protected Class` `toolConfigurationClass`

### Constructor Summary

Constructors
Constructor and Description
`XmlFactoryConfigurationRuleSet()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addRuleInstances(org.apache.commons.digester3.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.digester3.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.digester3.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.

Parameters:
  `digester` - Digester instance to which the new Rule instances should be added.