org.apache.commons.digester.xmlrules

Class FromXmlRuleSet

public class FromXmlRuleSet extends RuleSetBase

A Digester rule set where the rules come from an XML file.

Since: 1.2

Nested Class Summary
classFromXmlRuleSet.InputSourceXMLRulesLoader
Loads XMLRules from an InputSource
classFromXmlRuleSet.URLXMLRulesLoader
Loads XMLRules from an URL
abstract static classFromXmlRuleSet.XMLRulesLoader
Worker class encapsulates loading mechanisms.
Field Summary
static StringDIGESTER_DTD_PATH
DigesterRuleParserparser
The rule set for parsing the Digester rules
DigesterrulesDigester
The digester for loading the rules xml.
FromXmlRuleSet.XMLRulesLoaderrulesLoader
The file containing the Digester rules, in XML.
Constructor Summary
FromXmlRuleSet(URL rulesXml)
Constructs a FromXmlRuleSet using the default DigesterRuleParser and rulesDigester.
FromXmlRuleSet(URL rulesXml, Digester rulesDigester)
Constructs a FromXmlRuleSet using the default DigesterRuleParser and a ruleDigester for loading the rules xml.
FromXmlRuleSet(URL rulesXml, DigesterRuleParser parser)
FromXmlRuleSet(URL rulesXml, DigesterRuleParser parser, Digester rulesDigester)
FromXmlRuleSet(InputSource inputSource)
Constructs a FromXmlRuleSet using the default DigesterRuleParser and rulesDigester.
FromXmlRuleSet(InputSource inputSource, Digester rulesDigester)
Constructs a FromXmlRuleSet using the default DigesterRuleParser and a ruleDigester for loading the rules xml.
FromXmlRuleSet(InputSource inputSource, DigesterRuleParser parser)
FromXmlRuleSet(InputSource inputSource, DigesterRuleParser parser, Digester rulesDigester)
Method Summary
voidaddRuleInstances(Digester digester)
Adds to the digester the set of Rule instances defined in the XML file for this rule set.
voidaddRuleInstances(Digester digester, String basePath)
Adds to the digester the set of Rule instances defined in the XML file for this rule set.
voidinit(FromXmlRuleSet.XMLRulesLoader rulesLoader, DigesterRuleParser parser, Digester rulesDigester)
Base constructor

Field Detail

DIGESTER_DTD_PATH

public static final String DIGESTER_DTD_PATH

parser

private DigesterRuleParser parser
The rule set for parsing the Digester rules

rulesDigester

private Digester rulesDigester
The digester for loading the rules xml.

rulesLoader

private FromXmlRuleSet.XMLRulesLoader rulesLoader
The file containing the Digester rules, in XML.

Constructor Detail

FromXmlRuleSet

public FromXmlRuleSet(URL rulesXml)
Constructs a FromXmlRuleSet using the default DigesterRuleParser and rulesDigester.

Parameters: rulesXml the path to the XML document defining the Digester rules

FromXmlRuleSet

public FromXmlRuleSet(URL rulesXml, Digester rulesDigester)
Constructs a FromXmlRuleSet using the default DigesterRuleParser and a ruleDigester for loading the rules xml.

Parameters: rulesXml the path to the XML document defining the Digester rules rulesDigester the digester to read the rules xml.

FromXmlRuleSet

public FromXmlRuleSet(URL rulesXml, DigesterRuleParser parser)

Parameters: rulesXml the path to the XML document defining the Digester rules parser an instance of DigesterRuleParser, for parsing the rules from XML

FromXmlRuleSet

public FromXmlRuleSet(URL rulesXml, DigesterRuleParser parser, Digester rulesDigester)

Parameters: rulesXml the path to the XML document defining the Digester rules parser an instance of DigesterRuleParser, for parsing the rules from XML rulesDigester the digester used to load the Xml rules.

FromXmlRuleSet

public FromXmlRuleSet(InputSource inputSource)
Constructs a FromXmlRuleSet using the default DigesterRuleParser and rulesDigester.

Parameters: inputSource load the xml rules from this InputSource

FromXmlRuleSet

public FromXmlRuleSet(InputSource inputSource, Digester rulesDigester)
Constructs a FromXmlRuleSet using the default DigesterRuleParser and a ruleDigester for loading the rules xml.

Parameters: inputSource load the xml rules from this InputSource rulesDigester the digester to read the rules xml.

FromXmlRuleSet

public FromXmlRuleSet(InputSource inputSource, DigesterRuleParser parser)

Parameters: inputSource load the xml rules from this InputSource parser an instance of DigesterRuleParser, for parsing the rules from XML

FromXmlRuleSet

public FromXmlRuleSet(InputSource inputSource, DigesterRuleParser parser, Digester rulesDigester)

Parameters: inputSource load the xml rules from this InputSource parser an instance of DigesterRuleParser, for parsing the rules from XML rulesDigester the digester used to load the Xml rules.

Method Detail

addRuleInstances

public void addRuleInstances(Digester digester)
Adds to the digester the set of Rule instances defined in the XML file for this rule set.

See Also: RuleSetBase

addRuleInstances

public void addRuleInstances(Digester digester, String basePath)
Adds to the digester the set of Rule instances defined in the XML file for this rule set.

Note that this method doesn't have a matching one on the DigesterLoader class, because it is not expected to be widely used, and DigesterLoader's load method is already heavily overloaded.

Parameters: digester is the digester that rules will be added to. basePath is a path that will be prefixed to every pattern string defined in the xmlrules input file.

Since: 1.6

See Also: RuleSetBase

init

private void init(FromXmlRuleSet.XMLRulesLoader rulesLoader, DigesterRuleParser parser, Digester rulesDigester)
Base constructor
Copyright 2001-2005 The Apache Software Foundation.