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
,FunctionItem
,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) static String
getErrorCode
(IOException ioErr) int
getSpecialProperties
(Expression[] arguments) Determine the special properties of this function.static XPathException
handleIOError
(URI absoluteURI, IOException ioErr) static void
readFile
(URI absoluteURI, String encoding, UniStringConsumer output, XPathContext context) Supporting routine to load one external file given a URI (href) and a baseURIstatic UnicodeString
readFile
(IntPredicateProxy checker, Reader reader) Read the contents of an unparsed text filestatic void
readFile
(IntPredicateProxy checker, Reader reader, UniStringConsumer 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, getContextNode, getDescription, getDetails, getElaborator, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getStaticBaseUriString, getStreamerName, getUniStringArg, hashCode, importAttributes, isSequenceVariadic, isTrustedResultType, makeCall, makeFunction, makeFunction40, makeFunctionCall, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCaller
Methods inherited from class net.sf.saxon.functions.AbstractFunction
atomize, deepEqual40, deepEquals, effectiveBooleanValue, getAnnotations, getUnicodeStringValue, isArray, isMap, makeNewContext, simplify, typeCheck
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.saxon.om.FunctionItem
getGenre
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
Methods inherited from interface net.sf.saxon.om.Item
getLength, getStringValue, 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- Returns:
- the properties
-
readFile
public static void readFile(URI absoluteURI, String encoding, UniStringConsumer 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
-
getErrorCode
-
readFile
public static UnicodeString readFile(IntPredicateProxy 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
UnicodeString
- Throws:
IOException
- if a failure occurs reading the fileXPathException
- if the file contains illegal characters
-
readFile
public static void readFile(IntPredicateProxy checker, Reader reader, UniStringConsumer 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
-