Examples of IEnumerable


Examples of cli.System.Collections.IEnumerable

     *         an empty iterator.
     */

    public SequenceIterator resolve(String href, String base, XPathContext context) throws XPathException {
        if (href == null) {
            IEnumerable ie = registeredCollections.get("");
            if (ie == null) {
                return super.resolve(href, base, context);
            }
            return new UriIterator(ie);
        }
        URI relativeURI;
        try {
            relativeURI = new URI(ResolveURI.escapeSpaces(href));
        } catch (URISyntaxException e) {
            XPathException err = new XPathException("Invalid relative URI " + Err.wrap(href, Err.VALUE) +
                    " passed to collection() function");
            err.setErrorCode("FODC0004");
            err.setXPathContext(context);
            throw err;
        }
        URI abs = makeAbsoluteURI(href, base, context, relativeURI);       
        IEnumerable ie = registeredCollections.get(abs.toString());
        if (ie == null) {
            return super.resolve(href, base, context);
        }
        return new UriIterator(ie);
    }
View Full Code Here

Examples of cli.System.Collections.IEnumerable

     *         an empty iterator.
     */

    public SequenceIterator resolve(String href, String base, XPathContext context) throws XPathException {
        if (href == null) {
            IEnumerable ie = (IEnumerable)registeredCollections.get("");
            if (ie == null) {
                return super.resolve(href, base, context);
//                XPathException de = new XPathException("Default collection is undefined");
//                de.setErrorCode("FODC0002");
//                de.setXPathContext(context);
//                throw de;
            }
            return new UriIterator(ie.GetEnumerator());
        }
        URI abs;
        try {
            abs = new URI(base).resolve(href);
        } catch (URISyntaxException err) {
            XPathException de = new XPathException("Invalid collection URI " + base + ", " + href);
            de.setErrorCode("FODC0002");
            de.setXPathContext(context);
            throw de;
        }

        IEnumerable ie = (IEnumerable)registeredCollections.get(abs.toString());
        if (ie == null) {
            return super.resolve(href, base, context);
//            XPathException err = new XPathException("Unknown collection " + abs);
//            err.setErrorCode("FODC0004");
//            err.setXPathContext(context);
//            throw err;
        }
        return new UriIterator(ie.GetEnumerator());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.