org.dom4j.rule
Class RuleManager

java.lang.Object
  extended byorg.dom4j.rule.RuleManager

public class RuleManager
extends java.lang.Object

RuleManager manages a set of rules such that a rule can be found for a given DOM4J Node using the XSLT processing model.

Version:
$Revision: 1.4 $
Author:
James Strachan

Constructor Summary
RuleManager()
           
 
Method Summary
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(java.lang.String modeName, Node node)
          Performs an XSLT processing model match for the rule which matches the given Node the best.
 Mode getMode(java.lang.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()|@*"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleManager

public RuleManager()
Method Detail

getMode

public Mode getMode(java.lang.String modeName)
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 any
node - 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()
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()|@*"


createMode

protected Mode createMode()
A factory method to return a new Mode instance which should add the necessary default rules


addDefaultRules

protected void addDefaultRules(Mode mode)
Adds the default stylesheet rules to the given Mode instance


addDefaultRule

protected void addDefaultRule(Mode mode,
                              Pattern pattern,
                              Action action)

createDefaultRule

protected Rule createDefaultRule(Pattern pattern,
                                 Action action)


Copyright © 2001 MetaStuff Ltd. All Rights Reserved. Hosted by

SourceForge Logo