public class Rule
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected RuleTarget |
action |
protected int |
minImportPrecedence |
protected Rule |
next |
protected Pattern |
pattern |
protected int |
precedence |
protected double |
priority |
protected int |
sequence |
Constructor and Description |
---|
Rule() |
Rule(Pattern p,
RuleTarget o,
int prec,
int min,
double prio,
int seq)
Create a Rule.
|
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.
|
Rule |
copy(boolean copyChain) |
protected void |
copyFrom(Rule r,
boolean copyChain)
Copy a rule, including optionally the chain of rules linked to it
|
void |
export(ExpressionPresenter out,
boolean modeStreamable)
Export this rule
|
void |
exportOtherProperties(ExpressionPresenter out)
Add other exported properties as required
|
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) |
protected Pattern pattern
protected RuleTarget action
protected int precedence
protected int minImportPrecedence
protected double priority
protected Rule next
protected int sequence
public Rule()
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 rulesprotected void copyFrom(Rule r, boolean copyChain)
r
- the rule to be copiedcopyChain
- true if the whole chain of rules is to be copiedpublic Rule copy(boolean copyChain)
public 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 void export(ExpressionPresenter out, boolean modeStreamable) throws XPathException
out
- the destination for the exportmodeStreamable
- if the mode for this rule is streamable (should be EE only?)XPathException
public void exportOtherProperties(ExpressionPresenter out) throws XPathException
out
- the export destinationXPathException
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-2018 Saxonica Limited. All rights reserved.