Package net.sf.saxon.trans.rules
Class Rule
java.lang.Object
net.sf.saxon.trans.rules.Rule
- Direct Known Subclasses:
RuleEE
Rule: common functionality representing an abstraction of a template rule, a strip-space rule,
or an accumulator rule
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RuleTargetprotected intprotected Ruleprotected intprotected Patternprotected intprotected doubleprotected int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRule()Rule(Pattern p, RuleTarget o, int prec, int min, double prio, int seq, int part) Create a Rule. -
Method Summary
Modifier and TypeMethodDescriptionintcompareComputedRank(Rule other) Rules have an ordering, based on their precedence and priority.intcompareRank(Rule other) Rules have an ordering, based on their precedence and priority.voidexport(ExpressionPresenter out, boolean modeStreamable) Export this rulevoidAdd other exported properties as requiredintgetNext()intintdoubleintgetRank()intbooleanbooleanmatches(Item item, XPathContextMajor context) voidsetAction(RuleTarget action) voidsetAlwaysMatches(boolean matches) voidvoidsetPattern(Pattern pattern) voidsetRank(int rank)
-
Field Details
-
pattern
-
action
-
precedence
protected int precedence -
minImportPrecedence
protected int minImportPrecedence -
priority
protected double priority -
next
-
sequence
protected int sequence -
part
protected int part
-
-
Constructor Details
-
Rule
protected Rule() -
Rule
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
-
-
Method Details
-
getSequence
public int getSequence() -
getPartNumber
public int getPartNumber() -
setAction
-
getAction
-
getNext
-
setNext
-
getPattern
-
setPattern
-
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() -
export
Export this rule- Parameters:
out- the destination for the exportmodeStreamable- if the mode for this rule is streamable (should be EE only?)- Throws:
XPathException
-
exportOtherProperties
Add other exported properties as required- Parameters:
out- the export destination- Throws:
XPathException
-
compareRank
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
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
-
matches
- Throws:
XPathException
-