Class FromXmlRuleSet
java.lang.Object
org.apache.commons.digester.RuleSetBase
org.apache.commons.digester.xmlrules.FromXmlRuleSet
- All Implemented Interfaces:
RuleSet
A Digester rule set where the rules come from an XML file.
- Since:
- 1.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classLoads XMLRules from an InputSourceprivate classLoads XMLRules from an URLprivate static classWorker class encapsulates loading mechanisms. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprivate DigesterRuleParserThe rule set for parsing the Digester rulesprivate DigesterThe digester for loading the rules xml.private FromXmlRuleSet.XMLRulesLoaderThe file containing the Digester rules, in XML.Fields inherited from class org.apache.commons.digester.RuleSetBase
namespaceURI -
Constructor Summary
ConstructorsConstructorDescriptionFromXmlRuleSet(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
Modifier and TypeMethodDescriptionvoidaddRuleInstances(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.private voidinit(FromXmlRuleSet.XMLRulesLoader rulesLoader, DigesterRuleParser parser, Digester rulesDigester) Base constructorMethods inherited from class org.apache.commons.digester.RuleSetBase
getNamespaceURI
-
Field Details
-
DIGESTER_DTD_PATH
- See Also:
-
rulesLoader
The file containing the Digester rules, in XML. -
parser
The rule set for parsing the Digester rules -
rulesDigester
The digester for loading the rules xml.
-
-
Constructor Details
-
FromXmlRuleSet
Constructs a FromXmlRuleSet using the default DigesterRuleParser and rulesDigester.- Parameters:
rulesXml- the path to the XML document defining the Digester rules
-
FromXmlRuleSet
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 rulesrulesDigester- the digester to read the rules xml.
-
FromXmlRuleSet
- Parameters:
rulesXml- the path to the XML document defining the Digester rulesparser- an instance of DigesterRuleParser, for parsing the rules from XML
-
FromXmlRuleSet
- Parameters:
rulesXml- the path to the XML document defining the Digester rulesparser- an instance of DigesterRuleParser, for parsing the rules from XMLrulesDigester- the digester used to load the Xml rules.
-
FromXmlRuleSet
Constructs a FromXmlRuleSet using the default DigesterRuleParser and rulesDigester.- Parameters:
inputSource- load the xml rules from this InputSource
-
FromXmlRuleSet
Constructs a FromXmlRuleSet using the default DigesterRuleParser and a ruleDigester for loading the rules xml.- Parameters:
inputSource- load the xml rules from this InputSourcerulesDigester- the digester to read the rules xml.
-
FromXmlRuleSet
- Parameters:
inputSource- load the xml rules from this InputSourceparser- an instance of DigesterRuleParser, for parsing the rules from XML
-
FromXmlRuleSet
- Parameters:
inputSource- load the xml rules from this InputSourceparser- an instance of DigesterRuleParser, for parsing the rules from XMLrulesDigester- the digester used to load the Xml rules.
-
-
Method Details
-
init
private void init(FromXmlRuleSet.XMLRulesLoader rulesLoader, DigesterRuleParser parser, Digester rulesDigester) Base constructor -
addRuleInstances
Adds to the digester the set of Rule instances defined in the XML file for this rule set.- Specified by:
addRuleInstancesin interfaceRuleSet- Specified by:
addRuleInstancesin classRuleSetBase- Parameters:
digester- Digester instance to which the new Rule instances should be added.- Throws:
XmlLoadException- See Also:
-
addRuleInstances
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.- Throws:
XmlLoadException- Since:
- 1.6
- See Also:
-