|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.trans.Mode
public class Mode
A Mode is a collection of rules; the selection of a rule to apply to a given element is determined by a Pattern.
Field Summary | |
---|---|
static int |
ALL_MODES
|
static int |
DEFAULT_MODE
|
static int |
NAMED_MODE
|
static int |
STRIPPER_MODE
|
Constructor Summary | |
---|---|
Mode(int usage,
int nameCode)
Default constructor - creates a Mode containing no rules |
|
Mode(Mode omniMode,
int modeNameCode)
Construct a new Mode, copying the contents of an existing Mode |
Method Summary | |
---|---|
void |
addRule(Pattern p,
Object action,
int precedence,
double priority)
Add a rule to the Mode. |
int |
getList(int fingerprint,
int type)
Determine which list to use for a given pattern (we must also search the generic list) |
int |
getModeNameCode()
Get the name of the mode (for diagnostics only) |
Rule |
getNextMatchRule(NodeInfo node,
Rule currentRule,
XPathContext context)
Get the rule corresponding to a given Node, by finding the next-best Pattern match after the specified object. |
Rule |
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. |
Rule |
getRule(NodeInfo node,
XPathContext context)
Get the rule corresponding to a given Node, by finding the best Pattern match. |
boolean |
isDefaultMode()
Determine if this is the default mode |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_MODE
public static final int ALL_MODES
public static final int NAMED_MODE
public static final int STRIPPER_MODE
Constructor Detail |
---|
public Mode(int usage, int nameCode)
usage
- one of DEFAULT_MODE
, NAMED_MODE
, STRIPPER_MODE
public Mode(Mode omniMode, int modeNameCode)
omniMode
- the existing mode. May be null, in which case it is not copiedMethod Detail |
---|
public boolean isDefaultMode()
public int getModeNameCode()
public void addRule(Pattern p, Object action, int precedence, double priority)
p
- a Patternaction
- the Object to return from getRule() when the supplied node matches this Patternprecedence
- the import precedence of the rulepriority
- the explicit or implicit priority of the rulepublic int getList(int fingerprint, int type)
public Rule getRule(NodeInfo node, XPathContext context) throws XPathException
node
- the NodeInfo referring to the node to be matched
XPathException
public Rule getRule(NodeInfo node, int min, int max, XPathContext context) throws XPathException
node
- the NodeInfo referring to the node to be matched
XPathException
public Rule getNextMatchRule(NodeInfo node, Rule currentRule, XPathContext context) throws XPathException
node
- the NodeInfo referring to the node to be matched
XPathException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |