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
public abstract class UnparsedTextFunction extends SystemFunction
Abstract superclass containing common code supporting the functions unparsed-text(), unparsed-text-lines(), and unparsed-text-available()
-
-
Constructor Summary
Constructors Constructor Description UnparsedTextFunction()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.net.URI
getAbsoluteURI(java.lang.String href, java.lang.String baseURI, XPathContext context)
static java.lang.String
getErrorCode(java.io.IOException ioErr)
int
getSpecialProperties(Expression[] arguments)
Determine the special properties of this function.static XPathException
handleIOError(java.net.URI absoluteURI, java.io.IOException ioErr)
static void
readFile(java.net.URI absoluteURI, java.lang.String encoding, UniStringConsumer output, XPathContext context)
Supporting routine to load one external file given a URI (href) and a baseURIstatic UnicodeString
readFile(IntPredicateProxy checker, java.io.Reader reader)
Read the contents of an unparsed text filestatic void
readFile(IntPredicateProxy checker, java.io.Reader reader, UniStringConsumer output)
Read the contents of an unparsed text file-
Methods 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, getUniStringArg, hashCode, importAttributes, isSequenceVariadic, 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, getSerialNumber, 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.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
-
-
-
-
Method Detail
-
getSpecialProperties
public int getSpecialProperties(Expression[] arguments)
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(java.net.URI absoluteURI, java.lang.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 java.net.URI getAbsoluteURI(java.lang.String href, java.lang.String baseURI, XPathContext context) throws XPathException
- Throws:
XPathException
-
handleIOError
public static XPathException handleIOError(java.net.URI absoluteURI, java.io.IOException ioErr)
-
getErrorCode
public static java.lang.String getErrorCode(java.io.IOException ioErr)
-
readFile
public static UnicodeString readFile(IntPredicateProxy checker, java.io.Reader reader) throws java.io.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:
java.io.IOException
- if a failure occurs reading the fileXPathException
- if the file contains illegal characters
-
readFile
public static void readFile(IntPredicateProxy checker, java.io.Reader reader, UniStringConsumer output) throws java.io.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:
java.io.IOException
- if a failure occurs reading the fileXPathException
- if the file contains illegal characters
-
-