public class Substring extends SystemFunction implements Callable
Constructor and Description |
---|
Substring() |
Modifier and Type | Method and Description |
---|---|
StringValue |
call(XPathContext context,
Sequence[] arguments)
Evaluate the expression
|
java.lang.String |
getCompilerName()
Get the (local) name of a class that can be used to generate bytecode for this
system function
|
static StringValue |
substring(StringValue sv,
NumericValue start)
Implement the substring function with two arguments.
|
static StringValue |
substring(StringValue sv,
NumericValue start,
NumericValue len)
Implement the substring function with three arguments.
|
Expression |
typeCheckCaller(FunctionCall caller,
ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Type-check the expression.
|
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, fixArguments, getArity, getCardinality, getContextNode, getDescription, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getStreamerName, getUniStringArg, hashCode, importAttributes, isSequenceVariadic, isTrustedResultType, makeCall, makeFunction, makeFunctionCall, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString
atomize, deepEquals, effectiveBooleanValue, getAnnotations, getUnicodeStringValue, isArray, isMap, makeNewContext, simplify, typeCheck
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getLength, getStringValue, head, isStreamed, itemAt, iterate, reduce, subsequence
asIterable, concatenate, containsNode, materialize
makeRepeatable
public Expression typeCheckCaller(FunctionCall caller, ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
typeCheckCaller
in class SystemFunction
caller
- the function call expression calling this functionvisitor
- the expression visitorcontextInfo
- static context information relating to the callXPathException
- if an error is detectedpublic static StringValue substring(StringValue sv, NumericValue start)
sv
- the string valuestart
- the numeric offset (1-based) of the first character to be included in the result
(if not an integer, the XPath rules apply)public static StringValue substring(StringValue sv, NumericValue start, NumericValue len)
sv
- the string valuestart
- the numeric offset (1-based) of the first character to be included in the result
(if not an integer, the XPath rules apply)len
- the length of the required substring (again, XPath rules apply)public StringValue call(XPathContext context, Sequence[] arguments) throws XPathException
call
in interface Callable
context
- the dynamic evaluation contextarguments
- the values of the arguments, supplied as SequencesXPathException
- if a dynamic error occurs during the evaluation of the expressionpublic java.lang.String getCompilerName()
SystemFunction
getCompilerName
in class SystemFunction
Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.