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)` |
    `int` | `getSpecialProperties​(Expression[] arguments)` | Determine the special properties of this function.
    `static XPathException` | `handleIOError​(java.net.URI absoluteURI, java.io.IOException ioErr, XPathContext context)` |
    `static void` | `readFile​(java.net.URI absoluteURI, java.lang.String encoding, CharSequenceConsumer output, XPathContext context)` | Supporting routine to load one external file given a URI (href) and a baseURI
    `static java.lang.CharSequence` | `readFile​(java.util.function.IntPredicate checker, java.io.Reader reader)` | Read the contents of an unparsed text file
    `static void` | `readFile​(java.util.function.IntPredicate checker, java.io.Reader reader, CharSequenceConsumer 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, 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.Function

      `call, getGenre`

    - ### 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 Detail

    - #### UnparsedTextFunction

          public UnparsedTextFunction()

  - ### 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 class `SystemFunction`
      Parameters:
        `arguments` - the actual arguments supplied in a call to the function

    - #### readFile

          public static void readFile​(java.net.URI absoluteURI,
                                      java.lang.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 URI
        `encoding` - the character encoding
        `output` - the consumer to which the contents of the file will be sent
        `context` - 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,
                                                     XPathContext context)

    - #### readFile

          public static java.lang.CharSequence readFile​(java.util.function.IntPredicate 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 characters
        `reader` - Reader to be used for reading the file
      Returns:
        the contents of the file, as a `CharSequence`
      Throws:
        `java.io.IOException` - if a failure occurs reading the file
        `XPathException` - if the file contains illegal characters

    - #### readFile

          public static void readFile​(java.util.function.IntPredicate checker,
                                      java.io.Reader reader,
                                      CharSequenceConsumer output)
                               throws java.io.IOException,
                                      XPathException

      Read the contents of an unparsed text file
      Parameters:
        `checker` - predicate for checking whether characters are valid XML characters
        `reader` - Reader to be used for reading the file
        `output` - a consumer object that is supplied incrementally with the contents of the file
      Throws:
        `java.io.IOException` - if a failure occurs reading the file
        `XPathException` - if the file contains illegal characters