Package com.saxonica.ee.trans
Class Characteristic
java.lang.Object
com.saxonica.ee.trans.Characteristic
- Direct Known Subclasses:
AncestorCharacteristic
,GeneralComparisonOperand
,NumericComparisonOperand
,TokenMatchOperand
A Characteristic represents a distinguishing feature of an item that may be used by several
patterns in a rule chain, and which can usefully be evaluated once for all rules in the rule chain.
Characteristics are evaluated in the course of evaluating preconditions, and their values may be
used again when evaluating a different precondition. For example (a classic DITA use case), the tokenized
value of an element's
@class
attribute is a characteristic that may be used by several
preconditions that test for the presence of particular tokens in the value.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Object
evaluate
(XPathContext context) Evaluate the value of this characteristic for the context itemfinal int
Get the slot number allocated to the value of this characteristic in theRuleSearchState
final void
setSlotNumber
(int slotNumber) Allocate a slot number to this characteristic in theRuleSearchState
-
Constructor Details
-
Characteristic
public Characteristic()
-
-
Method Details
-
getSlotNumber
public final int getSlotNumber()Get the slot number allocated to the value of this characteristic in theRuleSearchState
- Returns:
- the allocated slot number
-
setSlotNumber
public final void setSlotNumber(int slotNumber) Allocate a slot number to this characteristic in theRuleSearchState
- Parameters:
slotNumber
- the slot number to be allocated
-
evaluate
Evaluate the value of this characteristic for the context item- Parameters:
context
- the dynamic evaluation context; the context item is the item being matched- Returns:
- the value of the characteristic
- Throws:
XPathException
- if evaluation of the characteristic fails
-