public class Mode extends Object
Mode
manages a number of RuleSet instances
for the mode in a stylesheet.
It is responsible for finding the correct rule for a given DOM4J Node
using the XSLT processing model uses the smallest possible RuleSet to
reduce the number of Rule evaluations.
Modifier and Type | Field and Description |
---|---|
private Map |
attributeNameRuleSets
Map of exact (local) attribute names to RuleSet instances
|
private Map |
elementNameRuleSets
Map of exact (local) element names to RuleSet instances
|
private RuleSet[] |
ruleSets |
Constructor and Description |
---|
Mode() |
Modifier and Type | Method and Description |
---|---|
void |
addRule(Rule rule) |
protected Map |
addToNameMap(Map map,
String name,
Rule rule)
Adds the Rule to a RuleSet for the given name.
|
void |
applyTemplates(Document document) |
void |
applyTemplates(Element element) |
void |
fireRule(Node node)
Runs the actions associated with the given node
|
Rule |
getMatchingRule(Node node)
Performs an XSLT processing model match for the rule
which matches the given Node the best.
|
protected RuleSet |
getRuleSet(int matchType) |
protected void |
removeFromNameMap(Map map,
String name,
Rule rule) |
void |
removeRule(Rule rule) |
private Map elementNameRuleSets
private Map attributeNameRuleSets
public Mode()
public void fireRule(Node node) throws Exception
Exception
public void applyTemplates(Element element) throws Exception
Exception
public void applyTemplates(Document document) throws Exception
Exception
public void removeRule(Rule rule)
public Rule getMatchingRule(Node node)
node
- is the DOM4J Node to match againstprotected RuleSet getRuleSet(int matchType)
protected Map addToNameMap(Map map, String name, Rule rule)
protected void removeFromNameMap(Map map, String name, Rule rule)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses