net.sf.saxon.trans
public final class RuleManager extends Object implements Serializable
Version: 10 December 1999: carved out of the old Controller class
Constructor Summary | |
---|---|
RuleManager()
create a RuleManager and initialise variables. |
Method Summary | |
---|---|
void | computeRankings()
Allocate rankings to the rules within each mode. |
void | explainTemplateRules(ExpressionPresenter presenter)
Explain (that is, output the expression tree) all template rules |
Mode | getDefaultMode()
Get the mode object for the default (unnamed) mode |
Mode | getMode(StructuredQName modeName, boolean createIfAbsent)
Get the Mode object for a named mode. |
Rule | getNextMatchHandler(NodeInfo node, Mode mode, Rule currentRule, XPathContext c)
Get the next-match handler after the current one |
int | getRecoveryPolicy()
Get the policy for handling recoverable errors. |
Rule | getTemplateRule(NodeInfo node, Mode mode, XPathContext c)
Find the template rule registered for a particular node in a specific mode. |
Rule | getTemplateRule(NodeInfo node, Mode mode, int min, int max, XPathContext c)
Get a template rule whose import precedence is in a particular range. |
void | invertStreamableTemplates(Optimizer opt)
Invert streamable templates in all streamable modes |
void | resetHandlers()
Set up a new table of handlers. |
void | setHandler(Pattern pattern, Template eh, Mode mode, int precedence)
Register a handler for a particular pattern. |
void | setHandler(Pattern pattern, Template eh, Mode mode, int precedence, double priority)
Register a template for a particular pattern. |
void | setRecoveryPolicy(int policy)
Set the policy for handling recoverable errrors. |
Parameters: modeName The name of the mode. Supply null to get the default mode or Mode.ALL_MODES to get the Mode object containing "mode=all" rules createIfAbsent if true, then if the mode does not already exist it will be created. If false, then if the mode does not already exist the method returns null.
Returns: the Mode with this name
Parameters: node The node to be matched mode The processing mode currentRule The current template rule c The dynamic context for the transformation
Returns: The template rule to be executed
Throws: XPathException
Returns: the current policy.
Since: 9.2
Parameters: node The NodeInfo for the relevant node mode The processing mode c The controller for this transformation
Returns: The template rule that will process this node Returns null if there is no specific handler registered.
Parameters: node The node to be matched mode The mode for which a rule is required min The minimum import precedence that the rule must have max The maximum import precedence that the rule must have c The Controller for the transformation
Returns: The template rule to be invoked
Throws: XPathException
Parameters: pattern A match pattern eh The Template to be used mode The processing mode precedence The import precedence (use 0 by default)
Parameters: pattern Must be a valid Pattern. eh The Template to be used mode The processing mode to which this template applies precedence The import precedence of this rule priority The priority of the rule: if an element matches several patterns, the one with highest priority is used
See Also: Pattern
Parameters: policy the recovery policy to be used. The options are RECOVER_SILENTLY, RECOVER_WITH_WARNINGS, or DO_NOT_RECOVER.
Since: 9.2