Top Description Fields Constructors Methods
org.dom4j.rule

public Class RuleManager

extends Object
Class Inheritance
Imports
java.util.HashMap, org.dom4j.Document, .Element, .Node, org.dom4j.rule.pattern.NodeTypePattern

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

Author
James Strachan
Version
$Revision: 1.9 $

Field Summary

Modifier and TypeField 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<String, Mode>
modes

Map of modes indexed by mode

private Action
valueOfAction

Holds value of property valueOfAction.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
addDefaultRule(Mode mode, Pattern pattern, Action action)

protected void
addDefaultRules(final Mode
DOCUMENT ME!
mode
)

Adds the default stylesheet rules to the given Modeinstance

public void
addRule(Rule rule)

public void
protected Rule
createDefaultRule(Pattern pattern, Action action)

protected Mode

Returns:

DOCUMENT ME!
createMode
()

A factory method to return a new Modeinstance which should add the necessary default rules

public Rule

Returns:

the matching Rule or no rule if none matched
getMatchingRule
(String
is the name of the mode associated with the rule if any
modeName
,
Node
is the DOM4J Node to match against
node
)

Performs an XSLT processing model match for the rule which matches the given Node the best.

public Mode

Returns:

the Mode instance for the given mode name. If one does not exist then it will be created.
getMode
(String
DOCUMENT ME!
modeName
)

DOCUMENT ME!

public Action

Returns:

the default value-of action which is used in the default rules for the pattern "text()|@"
getValueOfAction
()

DOCUMENT ME!

public void
public void
setValueOfAction(Action
DOCUMENT ME!
valueOfAction
)

Sets the default value-of action which is used in the default rules for the pattern "text()|@"

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

appearenceCountback to summary
private int appearenceCount

A counter so that rules can be ordered by the order in which they were added to the rule base

modesback to summary
private HashMap<String, Mode> modes

Map of modes indexed by mode

valueOfActionback to summary
private Action valueOfAction

Holds value of property valueOfAction.

Constructor Detail

RuleManagerback to summary
public RuleManager()

Method Detail

addDefaultRuleback to summary
protected void addDefaultRule(Mode mode, Pattern pattern, Action action)
addDefaultRulesback to summary
protected void addDefaultRules(final Mode mode)

Adds the default stylesheet rules to the given Modeinstance

Parameters
mode:Mode

DOCUMENT ME!

addRuleback to summary
public void addRule(Rule rule)
clearback to summary
public void clear()
createDefaultRuleback to summary
protected Rule createDefaultRule(Pattern pattern, Action action)
createModeback to summary
protected Mode createMode()

A factory method to return a new Modeinstance which should add the necessary default rules

Returns:Mode

DOCUMENT ME!

getMatchingRuleback to summary
public Rule getMatchingRule(String modeName, Node node)

Performs an XSLT processing model match for the rule which matches the given Node the best.

Parameters
modeName:String

is the name of the mode associated with the rule if any

node:Node

is the DOM4J Node to match against

Returns:Rule

the matching Rule or no rule if none matched

getModeback to summary
public Mode getMode(String modeName)

DOCUMENT ME!

Parameters
modeName:String

DOCUMENT ME!

Returns:Mode

the Mode instance for the given mode name. If one does not exist then it will be created.

getValueOfActionback to summary
public Action getValueOfAction()

DOCUMENT ME!

Returns:Action

the default value-of action which is used in the default rules for the pattern "text()|@"

removeRuleback to summary
public void removeRule(Rule rule)
setValueOfActionback to summary
public void setValueOfAction(Action valueOfAction)

Sets the default value-of action which is used in the default rules for the pattern "text()|@"

Parameters
valueOfAction:Action

DOCUMENT ME!