Package net.sf.saxon.functions
Class UnparsedTextFunction
java.lang.Object
net.sf.saxon.functions.AbstractFunction
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.UnparsedTextFunction
- All Implemented Interfaces:
Iterable<Function>,Callable,Function,GroundedValue<Function>,Item<Function>,Sequence<Function>
- Direct Known Subclasses:
UnparsedText,UnparsedTextAvailable,UnparsedTextLines
Abstract superclass containing common code supporting the functions
unparsed-text(), unparsed-text-lines(), and unparsed-text-available()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic URIgetAbsoluteURI(String href, String baseURI, XPathContext context) intgetSpecialProperties(Expression[] arguments) Determine the special properties of this function.static XPathExceptionhandleIOError(URI absoluteURI, IOException ioErr, XPathContext context) static CharSequencereadFile(URI absoluteURI, String encoding, XPathContext context) Supporting routine to load one external file given a URI (href) and a baseURIstatic CharSequencereadFile(IntPredicate checker, Reader reader) Read the contents of an unparsed text fileMethods inherited from class net.sf.saxon.functions.SystemFunction
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, fixArguments, getArity, getCardinality, getCompilerName, getContextNode, getDescription, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getStaticBaseUriString, getStreamerName, importAttributes, isTrustedResultType, makeCall, makeFunction, makeFunctionCall, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCallerMethods inherited from class net.sf.saxon.functions.AbstractFunction
atomize, deepEquals, effectiveBooleanValue, getAnnotations, getStringValue, getStringValueCS, isArray, isMap, makeNewContext, simplify, typeCheckMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, materializeMethods inherited from interface net.sf.saxon.om.Item
getLength, head, isStreamed, itemAt, iterate, iterator, reduce, subsequenceMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
UnparsedTextFunction
public UnparsedTextFunction()
-
-
Method Details
-
getSpecialProperties
Description copied from class:SystemFunctionDetermine the special properties of this function. The general rule is that a system function call is non-creative unless more details are defined in a subclass.- Overrides:
getSpecialPropertiesin classSystemFunction- Parameters:
arguments- the actual arguments supplied in a call to the function
-
readFile
public static CharSequence readFile(URI absoluteURI, String encoding, XPathContext context) throws XPathException Supporting routine to load one external file given a URI (href) and a baseURI- Parameters:
absoluteURI- the absolutized URIencoding- the character encodingcontext- the XPath dynamic context- Returns:
- the content of the file
- Throws:
XPathException- if the file cannot be read
-
getAbsoluteURI
public static URI getAbsoluteURI(String href, String baseURI, XPathContext context) throws XPathException - Throws:
XPathException
-
handleIOError
public static XPathException handleIOError(URI absoluteURI, IOException ioErr, XPathContext context) -
readFile
public static CharSequence readFile(IntPredicate checker, Reader reader) throws IOException, XPathException Read the contents of an unparsed text file- Parameters:
checker- predicate for checking whether characters are valid XML charactersreader- Reader to be used for reading the file- Returns:
- a CharSequence representing the contents of the file
- Throws:
IOException- if a failure occurs reading the fileXPathException- if the file contains illegal characters
-