org.apache.velocity.tools.config
Class XmlFactoryConfiguration
java.lang.Object
org.apache.velocity.tools.config.Configuration
org.apache.velocity.tools.config.CompoundConfiguration<ToolboxConfiguration>
org.apache.velocity.tools.config.FactoryConfiguration
org.apache.velocity.tools.config.FileFactoryConfiguration
org.apache.velocity.tools.config.XmlFactoryConfiguration
- All Implemented Interfaces:
- java.lang.Comparable<Configuration>
public class XmlFactoryConfiguration
- extends FileFactoryConfiguration
This reads in configuration info formatted as an XML file
using Commons-Digester
. This uses
XmlFactoryConfigurationRuleSet
as the default set of rules
for processing the XML. However, you may always change this by
passing a new RuleSet
to the setRuleSet(org.apache.commons.digester.RuleSet)
method.
See the configuration documentation on the main web site for
instructions on the XML format supported by the default rules.
- Version:
- $Id: XmlFactoryConfiguration.java 511959 2007-02-26 19:24:39Z nbubna $
- Author:
- Nathan Bubna
Method Summary |
org.apache.commons.digester.RuleSet |
getRuleSet()
Retrieves the rule set Digester should use to parse and load
the toolbox for this manager. |
void |
read(java.io.InputStream input)
Reads an XML document from an InputStream
and uses it to configure this FactoryConfiguration . |
void |
setRuleSet(org.apache.commons.digester.RuleSet rules)
Sets the RuleSet this loader will use to
digest the xml toolbox. |
Methods inherited from class org.apache.velocity.tools.config.FactoryConfiguration |
addConfiguration, addData, addSource, addToolbox, createFactory, equals, getData, getData, getData, getSources, getToolbox, getToolboxes, hasData, hashCode, removeData, removeToolbox, setData, setToolboxes, toString, toString, validate |
Methods inherited from class org.apache.velocity.tools.config.Configuration |
addConfiguration, addProperty, appendProperties, compareTo, getProperties, getProperty, getPropertyMap, hasProperties, removeProperty, removeProperty, setProperties, setProperty |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
ruleSet
private org.apache.commons.digester.RuleSet ruleSet
supportOldXml
private boolean supportOldXml
XmlFactoryConfiguration
public XmlFactoryConfiguration()
XmlFactoryConfiguration
public XmlFactoryConfiguration(boolean supportOldConfig)
XmlFactoryConfiguration
public XmlFactoryConfiguration(java.lang.String source)
XmlFactoryConfiguration
public XmlFactoryConfiguration(boolean supportOldConfig,
java.lang.String source)
setRuleSet
public void setRuleSet(org.apache.commons.digester.RuleSet rules)
- Sets the
RuleSet
this loader will use to
digest the xml toolbox.
getRuleSet
public org.apache.commons.digester.RuleSet getRuleSet()
Retrieves the rule set Digester should use to parse and load
the toolbox for this manager.
read
public void read(java.io.InputStream input)
throws java.io.IOException
Reads an XML document from an InputStream
and uses it to configure this FactoryConfiguration
.
- Specified by:
read
in class FileFactoryConfiguration
- Parameters:
input
- the InputStream to read from
- Throws:
java.io.IOException
Copyright (c) 2003-2007 Apache Software Foundation