Package net.sf.saxon.type.coercion
Class SingletonEnumerationCoercionPlan
java.lang.Object
net.sf.saxon.type.coercion.CoercionPlan
net.sf.saxon.type.coercion.AtomicCoercionPlan
net.sf.saxon.type.coercion.SingletonEnumerationCoercionPlan
Coercion plan for use with 4.0 when the required item type is a singleton enumeration type
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AtomicValueconvertUntyped(AtomicValue atom, ItemType requiredType, CoercionRequest request) Coerce an untyped atomic value to the required atomic type.protected AtomicValuepromote(AtomicValue atom, ItemType requiredType, CoercionRequest request) Promote an atomic value to the required atomic type.Methods inherited from class net.sf.saxon.type.coercion.AtomicCoercionPlan
coerceAtomicValue, coerceItem, getInstanceMethods inherited from class net.sf.saxon.type.coercion.CoercionPlan
check, coerceSequence, coercionError
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
SingletonEnumerationCoercionPlan
public SingletonEnumerationCoercionPlan()
-
-
Method Details
-
convertUntyped
protected AtomicValue convertUntyped(AtomicValue atom, ItemType requiredType, CoercionRequest request) throws XPathException Description copied from class:AtomicCoercionPlanCoerce an untyped atomic value to the required atomic type.- Overrides:
convertUntypedin classAtomicCoercionPlan- Parameters:
atom- the untyped atomic value to be convertedrequiredType- the required atomic typerequest- details of the coercion request for diagnostics- Returns:
- the converted atomic value
- Throws:
XPathException- if conversion fails
-
promote
protected AtomicValue promote(AtomicValue atom, ItemType requiredType, CoercionRequest request) throws XPathException Description copied from class:AtomicCoercionPlanPromote an atomic value to the required atomic type. This handles, for example, decimal to string conversion or base64Binary to hexBinary. It also handles down-casting to derived atomic types. The default implementation returns the supplied value unchanged.- Overrides:
promotein classAtomicCoercionPlan- Parameters:
atom- the untyped atomic value to be convertedrequiredType- the required atomic typerequest- details of the coercion request for diagnostics- Returns:
- the converted atomic value
- Throws:
XPathException- if conversion fails
-