Package net.sf.saxon.trans
Class Rule
- java.lang.Object
-
- net.sf.saxon.trans.Rule
-
- All Implemented Interfaces:
java.io.Serializable
public final class Rule extends java.lang.Object implements java.io.Serializable
Rule: a template rule, or a strip-space rule used to support the implementation- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Rule(Pattern p, RuleTarget o, int prec, int min, double prio, int seq)
Create a Rule.Rule(Rule r)
Copy a rule, including the chain of rules linked to it
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareComputedRank(Rule other)
Rules have an ordering, based on their precedence and priority.int
compareRank(Rule other)
Rules have an ordering, based on their precedence and priority.RuleTarget
getAction()
int
getMinImportPrecedence()
Rule
getNext()
Pattern
getPattern()
int
getPrecedence()
double
getPriority()
int
getRank()
int
getSequence()
boolean
isAlwaysMatches()
void
setAction(RuleTarget action)
void
setAlwaysMatches(boolean matches)
void
setNext(Rule next)
void
setRank(int rank)
-
-
-
Constructor Detail
-
Rule
public Rule(Pattern p, RuleTarget o, int prec, int min, double prio, int seq)
Create a Rule.- Parameters:
p
- the pattern that this rule matcheso
- the object invoked by this rule (usually a Template)prec
- the precedence of the rulemin
- the minumum import precedence for xsl:apply-importsprio
- the priority of the ruleseq
- a sequence number for ordering of rules
-
Rule
public Rule(Rule r)
Copy a rule, including the chain of rules linked to it- Parameters:
r
- the rule to be copied
-
-
Method Detail
-
getSequence
public int getSequence()
-
setAction
public void setAction(RuleTarget action)
-
getAction
public RuleTarget getAction()
-
getNext
public Rule getNext()
-
setNext
public void setNext(Rule next)
-
getPattern
public Pattern getPattern()
-
getPrecedence
public int getPrecedence()
-
getMinImportPrecedence
public int getMinImportPrecedence()
-
getPriority
public double getPriority()
-
setAlwaysMatches
public void setAlwaysMatches(boolean matches)
-
isAlwaysMatches
public boolean isAlwaysMatches()
-
setRank
public void setRank(int rank)
-
getRank
public int getRank()
-
compareRank
public int compareRank(Rule other)
Rules have an ordering, based on their precedence and priority. This method compares them using the precomputed rank value.- Parameters:
other
- Another rule whose ordering rank is to be compared with this one- Returns:
- <0 if this rule has lower rank, that is if it has lower precedence or equal precedence and lower priority. 0 if the two rules have equal precedence and priority. >0 if this rule has higher rank in precedence/priority order
-
compareComputedRank
public int compareComputedRank(Rule other)
Rules have an ordering, based on their precedence and priority.- Parameters:
other
- Another rule whose ordering rank is to be compared with this one- Returns:
- <0 if this rule has lower rank, that is if it has lower precedence or equal precedence and lower priority. 0 if the two rules have equal precedence and priority. >0 if this rule has higher rank in precedence/priority order
-
-