org.apache.commons.digester.xmlrules
Class FromXmlRuleSet

java.lang.Object
  extended by org.apache.commons.digester.RuleSetBase
      extended by org.apache.commons.digester.xmlrules.FromXmlRuleSet
All Implemented Interfaces:
RuleSet

public class FromXmlRuleSet
extends RuleSetBase

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

Since:
1.2

Field Summary
static String DIGESTER_DTD_PATH
           
 
Fields inherited from class org.apache.commons.digester.RuleSetBase
namespaceURI
 
Constructor Summary
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)
           
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)
           
 
Method Summary
 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, String basePath)
          Adds to the digester the set of Rule instances defined in the XML file for this rule set.
 
Methods inherited from class org.apache.commons.digester.RuleSetBase
getNamespaceURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIGESTER_DTD_PATH

public static final String DIGESTER_DTD_PATH
See Also:
Constant Field Values
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)
                      throws XmlLoadException
Adds to the digester the set of Rule instances defined in the XML file for this rule set.

Specified by:
addRuleInstances in interface RuleSet
Specified by:
addRuleInstances in class RuleSetBase
Parameters:
digester - Digester instance to which the new Rule instances should be added.
Throws:
XmlLoadException
See Also:
RuleSetBase

addRuleInstances

public void addRuleInstances(Digester digester,
                             String basePath)
                      throws XmlLoadException
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:
RuleSetBase


Copyright © 2001-2009 The Apache Software Foundation. All Rights Reserved.