public class FromXmlRuleSet extends RuleSetBase
Modifier and Type | Class and Description |
---|---|
private class |
FromXmlRuleSet.InputSourceXMLRulesLoader
Loads XMLRules from an InputSource
|
private class |
FromXmlRuleSet.URLXMLRulesLoader
Loads XMLRules from an URL
|
private static class |
FromXmlRuleSet.XMLRulesLoader
Worker class encapsulates loading mechanisms.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DIGESTER_DTD_PATH |
private DigesterRuleParser |
parser
The rule set for parsing the Digester rules
|
private Digester |
rulesDigester
The digester for loading the rules xml.
|
private FromXmlRuleSet.XMLRulesLoader |
rulesLoader
The file containing the Digester rules, in XML.
|
namespaceURI
Constructor and Description |
---|
FromXmlRuleSet(org.xml.sax.InputSource inputSource)
Constructs a FromXmlRuleSet using the default DigesterRuleParser and
rulesDigester.
|
FromXmlRuleSet(org.xml.sax.InputSource inputSource,
Digester rulesDigester)
Constructs a FromXmlRuleSet using the default DigesterRuleParser and
a ruleDigester for loading the rules xml.
|
FromXmlRuleSet(org.xml.sax.InputSource inputSource,
DigesterRuleParser parser) |
FromXmlRuleSet(org.xml.sax.InputSource inputSource,
DigesterRuleParser parser,
Digester rulesDigester) |
FromXmlRuleSet(java.net.URL rulesXml)
Constructs a FromXmlRuleSet using the default DigesterRuleParser and
rulesDigester.
|
FromXmlRuleSet(java.net.URL rulesXml,
Digester rulesDigester)
Constructs a FromXmlRuleSet using the default DigesterRuleParser and
a ruleDigester for loading the rules xml.
|
FromXmlRuleSet(java.net.URL rulesXml,
DigesterRuleParser parser) |
FromXmlRuleSet(java.net.URL rulesXml,
DigesterRuleParser parser,
Digester rulesDigester) |
Modifier and Type | Method and Description |
---|---|
void |
addRuleInstances(Digester digester)
Adds to the digester the set of Rule instances defined in the
XML file for this rule set.
|
void |
addRuleInstances(Digester digester,
java.lang.String basePath)
Adds to the digester the set of Rule instances defined in the
XML file for this rule set.
|
private void |
init(FromXmlRuleSet.XMLRulesLoader rulesLoader,
DigesterRuleParser parser,
Digester rulesDigester)
Base constructor
|
getNamespaceURI
public static final java.lang.String DIGESTER_DTD_PATH
private FromXmlRuleSet.XMLRulesLoader rulesLoader
private DigesterRuleParser parser
private Digester rulesDigester
public FromXmlRuleSet(java.net.URL rulesXml)
rulesXml
- the path to the XML document defining the Digester rulespublic FromXmlRuleSet(java.net.URL rulesXml, Digester rulesDigester)
rulesXml
- the path to the XML document defining the Digester rulesrulesDigester
- the digester to read the rules xml.public FromXmlRuleSet(java.net.URL rulesXml, DigesterRuleParser parser)
rulesXml
- the path to the XML document defining the Digester rulesparser
- an instance of DigesterRuleParser, for parsing the rules from XMLpublic FromXmlRuleSet(java.net.URL rulesXml, DigesterRuleParser parser, Digester rulesDigester)
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.public FromXmlRuleSet(org.xml.sax.InputSource inputSource)
inputSource
- load the xml rules from this InputSourcepublic FromXmlRuleSet(org.xml.sax.InputSource inputSource, Digester rulesDigester)
inputSource
- load the xml rules from this InputSourcerulesDigester
- the digester to read the rules xml.public FromXmlRuleSet(org.xml.sax.InputSource inputSource, DigesterRuleParser parser)
inputSource
- load the xml rules from this InputSourceparser
- an instance of DigesterRuleParser, for parsing the rules from XMLpublic FromXmlRuleSet(org.xml.sax.InputSource inputSource, DigesterRuleParser parser, Digester rulesDigester)
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.private void init(FromXmlRuleSet.XMLRulesLoader rulesLoader, DigesterRuleParser parser, Digester rulesDigester)
public void addRuleInstances(Digester digester) throws XmlLoadException
addRuleInstances
in interface RuleSet
addRuleInstances
in class RuleSetBase
digester
- Digester instance to which the new Rule instances
should be added.XmlLoadException
RuleSetBase
public void addRuleInstances(Digester digester, java.lang.String basePath) throws XmlLoadException
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.
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.XmlLoadException
RuleSetBase