| java.lang.Object net.sf.saxon.trans.Mode
Mode | public class Mode implements Serializable(Code) | | A Mode is a collection of rules; the selection of a rule to apply to a given element
is determined by a Pattern.
author: Michael H. Kay |
Inner Class :public static class Rule implements Serializable | |
Constructor Summary | |
public | Mode(int usage) | public | Mode(Mode omniMode) Construct a new Mode, copying the contents of an existing Mode
Parameters: omniMode - the existing mode. |
Method Summary | |
public void | addRule(Pattern p, Object obj, int precedence, double priority) Add a rule to the Mode. | public int | getList(int fingerprint, int type) | public Object | getNextMatchRule(NodeInfo node, Object currentHandler, XPathContext context) Get the rule corresponding to a given Node, by finding the next-best Pattern match
after the specified object.
Parameters: node - the NodeInfo referring to the node to be matched the object (e.g. | public Object | getRule(NodeInfo node, XPathContext context) Get the rule corresponding to a given Node, by finding the best Pattern match.
Parameters: node - the NodeInfo referring to the node to be matched the object (e.g. | public Object | getRule(NodeInfo node, int min, int max, XPathContext context) Get the rule corresponding to a given Node, by finding the best Pattern match, subject to a minimum
and maximum precedence. | public boolean | isDefaultMode() |
ALL_MODES | final public static int ALL_MODES(Code) | | |
DEFAULT_MODE | final public static int DEFAULT_MODE(Code) | | |
NAMED_MODE | final public static int NAMED_MODE(Code) | | |
STRIPPER_MODE | final public static int STRIPPER_MODE(Code) | | |
Mode | public Mode(Mode omniMode)(Code) | | Construct a new Mode, copying the contents of an existing Mode
Parameters: omniMode - the existing mode. May be null, in which case it is not copied |
addRule | public void addRule(Pattern p, Object obj, int precedence, double priority)(Code) | | Add a rule to the Mode.
The rule effectively replaces any other rule for the same pattern/mode at the same or a lower
priority.
Parameters: p - a Pattern Parameters: obj - the Object to return from getRule() when the supplied node matches this Pattern Parameters: precedence - the import precedence of the rule Parameters: priority - the explicit or implicit priority of the rule |
getList | public int getList(int fingerprint, int type)(Code) | | Determine which list to use for a given pattern (we must also search the generic list)
|
getNextMatchRule | public Object getNextMatchRule(NodeInfo node, Object currentHandler, XPathContext context) throws XPathException(Code) | | Get the rule corresponding to a given Node, by finding the next-best Pattern match
after the specified object.
Parameters: node - the NodeInfo referring to the node to be matched the object (e.g. a NodeHandler) registered for that element, if any (otherwise null). |
getRule | public Object getRule(NodeInfo node, XPathContext context) throws XPathException(Code) | | Get the rule corresponding to a given Node, by finding the best Pattern match.
Parameters: node - the NodeInfo referring to the node to be matched the object (e.g. a NodeHandler) registered for that element, if any (otherwise null). |
getRule | public Object getRule(NodeInfo node, int min, int max, XPathContext context) throws XPathException(Code) | | Get the rule corresponding to a given Node, by finding the best Pattern match, subject to a minimum
and maximum precedence. (This supports xsl:apply-imports)
Parameters: node - the NodeInfo referring to the node to be matched the object (e.g. a NodeHandler) registered for that element, if any (otherwise null). |
isDefaultMode | public boolean isDefaultMode()(Code) | | Determine if this is the default mode
|
|
|