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:
Callable
,Function
,GroundedValue
,Item
,Sequence
- 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 URI
getAbsoluteURI
(String href, String baseURI, XPathContext context) int
getSpecialProperties
(Expression[] arguments) Determine the special properties of this function.static XPathException
handleIOError
(URI absoluteURI, IOException ioErr, XPathContext context) static void
readFile
(URI absoluteURI, String encoding, CharSequenceConsumer output, XPathContext context) Supporting routine to load one external file given a URI (href) and a baseURIstatic CharSequence
readFile
(IntPredicate checker, Reader reader) Read the contents of an unparsed text filestatic void
readFile
(IntPredicate checker, Reader reader, CharSequenceConsumer output) 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, typeCheckCaller
Methods inherited from class net.sf.saxon.functions.AbstractFunction
atomize, deepEquals, effectiveBooleanValue, getAnnotations, getStringValue, getStringValueCS, isArray, isMap, makeNewContext, simplify, typeCheck
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
Methods inherited from interface net.sf.saxon.om.Item
getLength, head, isStreamed, itemAt, iterate, reduce, subsequence
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
UnparsedTextFunction
public UnparsedTextFunction()
-
-
Method Details
-
getSpecialProperties
Description copied from class:SystemFunction
Determine 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:
getSpecialProperties
in classSystemFunction
- Parameters:
arguments
- the actual arguments supplied in a call to the function
-
readFile
public static void readFile(URI absoluteURI, String encoding, CharSequenceConsumer output, 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 encodingoutput
- the consumer to which the contents of the file will be sentcontext
- the XPath dynamic context- 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:
- the contents of the file, as a
CharSequence
- Throws:
IOException
- if a failure occurs reading the fileXPathException
- if the file contains illegal characters
-
readFile
public static void readFile(IntPredicate checker, Reader reader, CharSequenceConsumer output) 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 fileoutput
- a consumer object that is supplied incrementally with the contents of the file- Throws:
IOException
- if a failure occurs reading the fileXPathException
- if the file contains illegal characters
-