Package org.dom4j.rule
Class RuleManager
- java.lang.Object
-
- org.dom4j.rule.RuleManager
-
public class RuleManager extends java.lang.ObjectRuleManagermanages a set of rules such that a rule can be found for a given DOM4J Node using the XSLT processing model.- Version:
- $Revision: 1.9 $
-
-
Field Summary
Fields Modifier and Type Field Description private intappearenceCountA counter so that rules can be ordered by the order in which they were added to the rule baseprivate java.util.HashMap<java.lang.String,Mode>modesMap of modes indexed by modeprivate ActionvalueOfActionHolds value of property valueOfAction.
-
Constructor Summary
Constructors Constructor Description RuleManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddDefaultRule(Mode mode, Pattern pattern, Action action)protected voidaddDefaultRules(Mode mode)Adds the default stylesheet rules to the givenModeinstancevoidaddRule(Rule rule)voidclear()protected RulecreateDefaultRule(Pattern pattern, Action action)protected ModecreateMode()A factory method to return a newModeinstance which should add the necessary default rulesRulegetMatchingRule(java.lang.String modeName, Node node)Performs an XSLT processing model match for the rule which matches the given Node the best.ModegetMode(java.lang.String modeName)DOCUMENT ME!ActiongetValueOfAction()DOCUMENT ME!voidremoveRule(Rule rule)voidsetValueOfAction(Action valueOfAction)Sets the default value-of action which is used in the default rules for the pattern "text()|@"
-
-
-
Field Detail
-
modes
private java.util.HashMap<java.lang.String,Mode> modes
Map of modes indexed by mode
-
appearenceCount
private int appearenceCount
A counter so that rules can be ordered by the order in which they were added to the rule base
-
valueOfAction
private Action valueOfAction
Holds value of property valueOfAction.
-
-
Method Detail
-
getMode
public Mode getMode(java.lang.String modeName)
DOCUMENT ME!- Parameters:
modeName- DOCUMENT ME!- Returns:
- the Mode instance for the given mode name. If one does not exist then it will be created.
-
addRule
public void addRule(Rule rule)
-
removeRule
public void removeRule(Rule rule)
-
getMatchingRule
public Rule getMatchingRule(java.lang.String modeName, Node node)
Performs an XSLT processing model match for the rule which matches the given Node the best.- Parameters:
modeName- is the name of the mode associated with the rule if anynode- is the DOM4J Node to match against- Returns:
- the matching Rule or no rule if none matched
-
clear
public void clear()
-
getValueOfAction
public Action getValueOfAction()
DOCUMENT ME!- Returns:
- the default value-of action which is used in the default rules for the pattern "text()|@"
-
setValueOfAction
public void setValueOfAction(Action valueOfAction)
Sets the default value-of action which is used in the default rules for the pattern "text()|@"- Parameters:
valueOfAction- DOCUMENT ME!
-
createMode
protected Mode createMode()
A factory method to return a newModeinstance which should add the necessary default rules- Returns:
- DOCUMENT ME!
-
addDefaultRules
protected void addDefaultRules(Mode mode)
Adds the default stylesheet rules to the givenModeinstance- Parameters:
mode- DOCUMENT ME!
-
-