Package javax.xml.xquery

Examples of javax.xml.xquery.XQException


        final Type type = type_;
        if(type instanceof PITest) {
            PITest pi = (PITest) type;
            return pi.getName();
        }
        throw new XQException("This method should not be called with the ItemType: " + type_, "err:XQJxxxx");
    }
View Full Code Here


                    }
                default:
                    break;
            }
        }
        throw new XQException("This method should not be called with the ItemType: " + type_, "err:XQJxxxx");
    }
View Full Code Here

    public abstract boolean accepts(Type expected);

    public abstract Class getJavaObjectType();

    public int getXQJBaseType() throws XQException { // should be overrided
        throw new XQException("Illegal type as an item kind: " + toString(), "err:XQJxxxx");
    }
View Full Code Here

    @Override
    public int getXQJBaseType() throws XQException {
        final ItemType basetype = nodeType;
        if(basetype == null) {
            throw new XQException("Illegal item kind: " + toString(), "err:XQJxxxx");
        }
        return basetype.getXQJBaseType();
    }
View Full Code Here

    @Override
    public int getXQJBaseType() throws XQException {
        final Type basetype = type;
        if(basetype == null) {
            throw new XQException("Illegal item kind: " + toString(), "err:XQJxxxx");
        }
        return basetype.getXQJBaseType();
    }
View Full Code Here

    @Override
    public int getXQJBaseType() throws XQException {
        final Type basetype = type;
        if(basetype == null) {
            throw new XQException("Illegal item kind: " + toString(), "err:XQJxxxx");
        }
        return basetype.getXQJBaseType();
    }
View Full Code Here

     * @throws XQException if the object has been closed
     */

    final void checkNotClosed() throws XQException {
        if (isClosed()) {
            throw new XQException("The XQJ object has been closed");
        }
    }
View Full Code Here

            if (it instanceof DocumentNodeTest) {
                it = ((DocumentNodeTest)it).getElementTest();
            }
            if ((it.getNodeKindMask() &
                    (1<<Type.DOCUMENT | 1<<Type.TEXT | 1<<Type.COMMENT | 1<<Type.PROCESSING_INSTRUCTION | 1<<Type.NAMESPACE)) != 0) {
                throw new XQException("Wrong node kind for getBaseType()");
            }
            SchemaType contentType = it.getContentType();
            if (contentType.isAtomicType()) {
                AtomicType at = (AtomicType)contentType;
                while (!at.isBuiltInType()) {
                    at = (AtomicType)at.getBaseType();
                }
                return SaxonXQDataFactory.mapSaxonTypeToXQJ(at.getFingerprint());
            } else if (contentType.isSimpleType()) {
                if (((SimpleType)contentType).isListType()) {
                    int fp = contentType.getFingerprint();
                    if (fp == StandardNames.XS_NMTOKENS) {
                        return XQBASETYPE_NMTOKENS;
                    } else if (fp == StandardNames.XS_ENTITIES) {
                        return XQBASETYPE_ENTITIES;
                    } else if (fp == StandardNames.XS_IDREFS) {
                        return XQBASETYPE_IDREFS;
                    }
                }
                return XQBASETYPE_ANYSIMPLETYPE;
            } else if (contentType == Untyped.getInstance()) {
                return XQBASETYPE_UNTYPED;
            } else {
                return XQBASETYPE_ANYTYPE;
            }

        } else {
            throw new XQException("Wrong item type for getBaseType()");
        }
    }
View Full Code Here

            type = ((DocumentNodeTest)type).getElementTest();
        }
        if (type instanceof NodeTest) {
            if ((((NodeTest)type).getNodeKindMask() &
                    (1<<Type.DOCUMENT | 1<<Type.TEXT | 1<<Type.COMMENT | 1<<Type.PROCESSING_INSTRUCTION | 1<<Type.NAMESPACE)) != 0) {
                throw new XQException("Wrong node kind for getNodeName()");
            }
            IntHashSet set = ((NodeTest)type).getRequiredNodeNames();
            if (set != null && set.size() == 1) {
                int fp = set.getFirst(-1);
                NamePool pool = config.getNamePool();
                String uri = pool.getURI(fp);
                String local = pool.getLocalName(fp);
                return new QName(uri, local);
            } else {
                return null;
            }
        }
        throw new XQException("getNodeName() is not defined for this kind of item type");
    }
View Full Code Here

            NamePool pool = config.getNamePool();
            return pool.getLocalName(((NameTest)itemType).getFingerprint());
        } else if (itemType instanceof NodeKindTest && itemType.getPrimitiveType() == Type.PROCESSING_INSTRUCTION) {
            return null;
        } else {
            throw new XQException("Item kind is not a processing instruction");
        }
    }
View Full Code Here

TOP

Related Classes of javax.xml.xquery.XQException

Copyright © 2018 www.massapicom. 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.