Package net.sf.saxon.type.coercion
Class IdentityCoercionPlan
java.lang.Object
net.sf.saxon.type.coercion.CoercionPlan
net.sf.saxon.type.coercion.IdentityCoercionPlan
Coercion plan for use when items do not need to be converted, but the cardinality needs to be checked
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncoerceItem(Item item, ItemType requiredType, CoercionRequest request) Apply the coercion rules (3.1: function conversion rules) to an item, given this target item type.static IdentityCoercionPlanMethods inherited from class net.sf.saxon.type.coercion.CoercionPlan
check, coerceSequence, coercionError
-
Constructor Details
-
IdentityCoercionPlan
public IdentityCoercionPlan()
-
-
Method Details
-
getInstance
-
coerceItem
public GroundedValue coerceItem(Item item, ItemType requiredType, CoercionRequest request) throws XPathException Apply the coercion rules (3.1: function conversion rules) to an item, given this target item type.- Specified by:
coerceItemin classCoercionPlan- Parameters:
item- the item to be coercedrequiredType- the required item typerequest- the input to the coercion- Returns:
- the converted value. We define this as a grounded value because in the vast majority of cases it will be a single item, and in other cases (a typed node with a list type, an array of atomic values) there is little benefit in lazy evaluation. The implementation is responsible for ensuring that the returned value does indeed consist entirely of items that match the required item type; it is not responsible for cardinality checking. The item type checking can be achieved, if required, by a callback to the check() method.
- Throws:
XPathException- if the value cannot be converted to the required type
-