Package net.sf.saxon.type.coercion
Class CoercionRules
java.lang.Object
net.sf.saxon.type.coercion.CoercionRules
Implementation of the coercion rules (3.0: function conversion rules) for dynamic
function calls. Converts a value supplied as an argument in a function call to
the required type. This is used primarily for dynamic function calls; for static calls
see the
TypeChecker class, which converts expressions rather than values. The class
is also used for converting external parameters to the required type.
There are separate versions of this class for XPath 3.1 and XPath 4.0.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncoerce(Sequence value, SequenceType requiredType, SequenceType knownType, Configuration config, Supplier<RoleDiagnostic> roleSupplier, Location locator) Apply the coercion rules (function conversion rules) to a value, given a required type.static CoercionRulesforVersion(Configuration config, int version)
-
Constructor Details
-
CoercionRules
-
-
Method Details
-
forVersion
-
coerce
public Sequence coerce(Sequence value, SequenceType requiredType, SequenceType knownType, Configuration config, Supplier<RoleDiagnostic> roleSupplier, Location locator) throws XPathException Apply the coercion rules (function conversion rules) to a value, given a required type.- Parameters:
value- a value to be convertedrequiredType- the required typeknownType- the item type of the supplied value, to the extent this is knownconfig- the Saxon configurationroleSupplier- identifies the value to be converted in error messageslocator- identifies the location for error messages- Returns:
- the converted value (possibly as a lazily-evaluated sequence)
- Throws:
XPathException- if the value cannot be converted to the required type
-