Class IncludeRule
- java.lang.Object
-
- org.apache.commons.digester3.Rule
-
- org.apache.commons.digester3.xmlrules.IncludeRule
-
final class IncludeRule extends Rule
A rule for including one rules XML file within another. Included files behave as if they are 'macro-expanded' within the includer. This means that the values of the pattern stack are prefixed to every pattern in the included rules.This rule will detect 'circular' includes, which would result in infinite recursion. It throws a CircularIncludeException when a cycle is detected, which will terminate the parse.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringCLASSPATH_URL_PREFIXprivate WithMemoryRulesBindermemoryRulesBinderprivate RulesBindertargetRulesBinder
-
Constructor Summary
Constructors Constructor Description IncludeRule(WithMemoryRulesBinder memoryRulesBinder, RulesBinder targetRulesBinder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbegin(java.lang.String namespace, java.lang.String name, org.xml.sax.Attributes attributes)This method is called when the beginning of a matching XML element is encountered.private voidinstall(RulesModule rulesModule)-
Methods inherited from class org.apache.commons.digester3.Rule
body, end, finish, getDigester, getNamespaceURI, setDigester, setNamespaceURI
-
-
-
-
Field Detail
-
CLASSPATH_URL_PREFIX
private static final java.lang.String CLASSPATH_URL_PREFIX
- See Also:
- Constant Field Values
-
memoryRulesBinder
private final WithMemoryRulesBinder memoryRulesBinder
-
targetRulesBinder
private final RulesBinder targetRulesBinder
-
-
Constructor Detail
-
IncludeRule
public IncludeRule(WithMemoryRulesBinder memoryRulesBinder, RulesBinder targetRulesBinder)
-
-
Method Detail
-
begin
public void begin(java.lang.String namespace, java.lang.String name, org.xml.sax.Attributes attributes) throws java.lang.ExceptionThis method is called when the beginning of a matching XML element is encountered.- Overrides:
beginin classRule- Parameters:
namespace- the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element has no namespacename- the local name if the parser is namespace aware, or just the element name otherwiseattributes- The attribute list of this element- Throws:
java.lang.Exception- if any error occurs
-
install
private void install(RulesModule rulesModule)
-
-