Class TreatFn
java.lang.Object
net.sf.saxon.functions.AbstractFunction
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.TreatFn
- All Implemented Interfaces:
Callable, Function, GroundedValue, Item, Sequence
- Direct Known Subclasses:
TreatFn.ExactlyOne, TreatFn.OneOrMore, TreatFn.ZeroOrOne
This class supports the XPath 2.0 functions exactly-one(), one-or-more(), zero-or-one().
Because Saxon doesn't do strict static type checking, these are essentially identity
functions; the run-time type checking is done as part of the function call mechanism
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall(XPathContext context, Sequence[] arguments) Invoke the functionabstract StringReturn the error code to be used for type errorsabstract intGet a name that identifies the class that can be used to evaluate this function in streaming mode, that is, supplying one item or event at a time as it is delivered by the parser.Methods inherited from class SystemFunction
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, fixArguments, getArity, getCardinality, getCompilerName, getContextNode, getDescription, getDetails, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, importAttributes, isTrustedResultType, makeCall, makeFunction, makeFunctionCall, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCallerMethods inherited from class AbstractFunction
atomize, deepEquals, effectiveBooleanValue, getAnnotations, getStringValue, getStringValueCS, isArray, isMap, makeNewContext, simplify, typeCheckMethods inherited from class Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface GroundedValue
asIterable, concatenate, containsNode, materializeMethods inherited from interface Item
getLength, head, isStreamed, itemAt, iterate, reduce, subsequenceMethods inherited from interface Sequence
makeRepeatable
-
Constructor Details
-
TreatFn
public TreatFn()
-
-
Method Details
-
getErrorCodeForTypeErrors
Return the error code to be used for type errors- Overrides:
getErrorCodeForTypeErrorsin classSystemFunction- Returns:
- the error code to be used for type errors in the function call. Normally XPTY0004, but different codes are used for functions such as exactly-one()
-
getRequiredCardinality
public abstract int getRequiredCardinality() -
call
Description copied from interface:FunctionInvoke the function- Specified by:
callin interfaceCallable- Specified by:
callin interfaceFunction- Parameters:
context- the XPath dynamic evaluation contextarguments- the actual arguments to be supplied- Returns:
- the result of invoking the function
- Throws:
XPathException- if a dynamic error occurs within the function
-
makeRoleDiagnostic
-
getStreamerName
Description copied from class:SystemFunctionGet a name that identifies the class that can be used to evaluate this function in streaming mode, that is, supplying one item or event at a time as it is delivered by the parser. Special streaming support is generally available in Saxon-EE for all system functions that take a sequence as their argument.- Overrides:
getStreamerNamein classSystemFunction- Returns:
- a name that identifies a class that supports streamed evaluation of this system
function, or null if no such class is available. The mapping of names to classes is
defined in the Saxon-EE class
StreamerMap. In non-streaming Saxon editions (HE and PE) the method always returns null.
-