public final class Rule extends Object
Constructor and 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
|
Modifier and Type | Method and 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() |
boolean |
matches(Item item,
XPathContextMajor context) |
void |
setAction(RuleTarget action) |
void |
setAlwaysMatches(boolean matches) |
void |
setNext(Rule next) |
void |
setPattern(Pattern pattern) |
void |
setRank(int rank) |
public Rule(Pattern p, RuleTarget o, int prec, int min, double prio, int seq)
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 rulespublic Rule(Rule r)
r
- the rule to be copiedpublic int getSequence()
public void setAction(RuleTarget action)
public RuleTarget getAction()
public Rule getNext()
public void setNext(Rule next)
public Pattern getPattern()
public void setPattern(Pattern pattern)
public int getPrecedence()
public int getMinImportPrecedence()
public double getPriority()
public void setAlwaysMatches(boolean matches)
public boolean isAlwaysMatches()
public void setRank(int rank)
public int getRank()
public int compareRank(Rule other)
other
- Another rule whose ordering rank is to be compared with this onepublic int compareComputedRank(Rule other)
other
- Another rule whose ordering rank is to be compared with this onepublic boolean matches(Item item, XPathContextMajor context) throws XPathException
XPathException
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.