Class IdentityCoercionPlan

java.lang.Object
net.sf.saxon.type.coercion.CoercionPlan
net.sf.saxon.type.coercion.IdentityCoercionPlan

public class IdentityCoercionPlan extends CoercionPlan
Coercion plan for use when items do not need to be converted, but the cardinality needs to be checked
  • Constructor Details

    • IdentityCoercionPlan

      public IdentityCoercionPlan()
  • Method Details

    • getInstance

      public static IdentityCoercionPlan 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:
      coerceItem in class CoercionPlan
      Parameters:
      item - the item to be coerced
      requiredType - the required item type
      request - 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