Debian Codegraph @

net/sf/saxon/lib/UnparsedTextURIResolver.java

raw symbols SCIP
1 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2018 Saxonica Limited.
3 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
6 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7
8 package net.sf.saxon.lib;
9
10 import net.sf.saxon.Configuration;
11 import net.sf.saxon.trans.XPathException;
12
13 import java.io.Reader;
14 import java.net.URI;
15
16 /**
17 * An UnparsedTextURIResolver accepts an absolute URI and optionally an encoding name as input,
18 * and returns a Reader as its result.
19 */
20
21 public interface UnparsedTextURIResolver {
22
23 /**
24 * Resolve the URI passed to the XSLT unparsed-text() function, after resolving
25 * against the base URI.
26 * <p>Note that a user-written resolver is responsible for enforcing some of the rules in the
27 * XSLT specification, such as the rules for inferring an encoding when none is supplied. Saxon
28 * will not report any error if the resolver does this in a non-conformant way.</p>
29 *
30 * @param absoluteURI the absolute URI obtained by resolving the supplied
31 * URI against the base URI
32 * @param encoding the encoding requested in the call of unparsed-text(), if any. Otherwise null.
33 * @param config The Saxon configuration. Provided in case the URI resolver
34 * needs it.
35 * @return a Reader, which Saxon will use to read the unparsed text. After the text has been read,
36 * the close() method of the Reader will be called. Returning null is not acceptable; if the
37 * resolver wishes to delegate to the standard resolver, it can do this by subclassing
38 * {@link StandardUnparsedTextResolver} and calling <code>super.resolve(...)</code>.
39 * @throws net.sf.saxon.trans.XPathException
40 * if any failure occurs
41 * @since 8.9
42 */
43
44 /*@NotNull*/
45 Reader resolve(URI absoluteURI, String encoding, Configuration config) throws XPathException;
46 }
47