public class RuleManager extends Object
RuleManager
manages a set of rules such that a rule
can be found for a given DOM4J Node using the XSLT processing model.
Modifier and Type | Field and Description |
---|---|
private int |
appearenceCount
A counter so that rules can be ordered by the order in which they
were added to the rule base
|
private HashMap |
modes
Map of modes indexed by mode
|
private Action |
valueOfAction
Holds value of property valueOfAction.
|
Constructor and Description |
---|
RuleManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
addDefaultRule(Mode mode,
Pattern pattern,
Action action) |
protected void |
addDefaultRules(Mode mode)
Adds the default stylesheet rules to the given
Mode instance |
void |
addRule(Rule rule) |
void |
clear() |
protected Rule |
createDefaultRule(Pattern pattern,
Action action) |
protected Mode |
createMode()
A factory method to return a new
Mode instance
which should add the necessary default rules |
Rule |
getMatchingRule(String modeName,
Node node)
Performs an XSLT processing model match for the rule
which matches the given Node the best.
|
Mode |
getMode(String modeName) |
Action |
getValueOfAction() |
void |
removeRule(Rule rule) |
void |
setValueOfAction(Action valueOfAction)
Sets the default value-of action which is used
in the default rules for the pattern "text()|@*"
|
private int appearenceCount
private Action valueOfAction
public RuleManager()
public Mode getMode(String modeName)
public void removeRule(Rule rule)
public Rule getMatchingRule(String modeName, Node node)
modeName
- is the name of the mode associated with the rule if anynode
- is the DOM4J Node to match againstpublic void clear()
public Action getValueOfAction()
public void setValueOfAction(Action valueOfAction)
protected Mode createMode()
Mode
instance
which should add the necessary default rulesprotected void addDefaultRules(Mode mode)
Mode
instanceprotected void addDefaultRule(Mode mode, Pattern pattern, Action action)
protected Rule createDefaultRule(Pattern pattern, Action action)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses