Package xbird.xquery

Examples of xbird.xquery.XQRTException


    }

    @Override
    public int compareTo(Item trg) {
        if(!(trg instanceof QNameValue)) {
            throw new XQRTException("err:XPTY0004", "Imcomparable "
                    + trg.getClass().getSimpleName() + " with QNameValue");
        }
        final QNameValue qname = (QNameValue) trg;
        final QualifiedName targetName = qname.getValue();
        if(value.equals(targetName)) {
View Full Code Here


        String typeName = baseName + '?';
        Type type = TypeRegistry.safeGet(typeName);
        if(type == null) {
            Type baseType = TypeRegistry.safeGet(baseName);
            if(baseType == null) {
                throw new XQRTException("err:XPST0051", "Type not found: " + type);
            }
            assert (baseType instanceof ItemType);
            type = new SequenceType((ItemType) baseType, Type.Occurrence.OCC_ZERO_OR_ONE);
        }
        return type;
View Full Code Here

        if(it instanceof AtomicValue) {
            return (AtomicValue) it;
        } else if(it instanceof XQNode) {
            final AtomicValue tv = ((XQNode) it).typedValue();
            if(tv == null) {
                throw new XQRTException("err:FOTY0012", "Atomization failed with a node has no typed value.");
            }
            return tv;
        } else {
            throw new XQRTException("err:XPTY0004", "Atomization failed for type `" + it.getType()
                    + '`');
        }
    }
View Full Code Here

    @Override
    public Focus iterator() {
        try {
            _sorter.sort();
        } catch (XQueryException e) {
            throw new XQRTException(e);
        }
        KeyStrippingIterator itor = new KeyStrippingIterator(_items, _orderSpecs);
        return new Focus(this, itor, _dynEnv); // FIXME
    }
View Full Code Here

    @Override
    public boolean isEmpty() {
        try {
            _sorter.sort();
        } catch (XQueryException e) {
            throw new XQRTException(e);
        }
        return _items.isEmpty();
    }
View Full Code Here

    public ElementTest(QualifiedName elementName, QualifiedName typeName, boolean isNillable) {
        super(NodeKind.ELEMENT);
        if(typeName != null) {
            final Type t = TypeRegistry.safeGet(typeName);
            if(t == null) {
                throw new XQRTException("err:XPST0001", "type '" + typeName + "' not resolved");
            }
            this.type = t;
        }
        this.elementName = elementName;
        this.typeName = typeName;
View Full Code Here

    public AttributeTest(byte nodeKind, QualifiedName attributeName, QualifiedName typeName) {
        super(nodeKind);
        if(typeName != null) {
            final Type t = TypeRegistry.safeGet(typeName);
            if(t == null) {
                throw new XQRTException("err:XPST0001", "type '" + typeName + "' not resolved");
            }
            this.type = t;
        }
        this.attributeName = attributeName;
        this.typeName = typeName;
View Full Code Here

    }

    @Override
    public int compareTo(Item trg) {
        if(!(trg instanceof AnyURIValue)) {
            throw new XQRTException("err:XPTY0004", "Imcomparable "
                    + trg.getClass().getSimpleName() + " with AnyURIValue");
        }
        URI trgUri = ((AnyURIValue) trg).value;
        return value.compareTo(trgUri);
    }
View Full Code Here

    }

    @Override
    public int compareTo(Item trg) {
        if(!(trg instanceof BinaryValue)) {
            throw new XQRTException("err:XPTY0004", "Imcomparable "
                    + trg.getClass().getSimpleName() + " with BinaryValue");
        }
        final String myValue = stringValue();
        final String trgValue = ((BinaryValue) trg).stringValue();
        return myValue.compareTo(trgValue);
View Full Code Here

                BTreeIndexer indexer = new BTreeIndexer(idxFile);
                final IndexMatch matched;
                try {
                    matched = indexer.find(idxCond);
                } catch (DbException e) {
                    throw new XQRTException("failed to query index: " + idxFile.getAbsolutePath(), e);
                }
                // TODO REVIEWME sort really required?
                final long[] ptrs = filter(matched.getMatchedUnsorted(), docName, idxFile);
                final int matchCounts = ptrs.length;
                if(LOG.isInfoEnabled()) {
                    LOG.info("Index scan done. matched: " + matched.countMatched() + ", filtered: "
                            + matchCounts);
                }
                if(matchCounts > 0) {
                    final IDocumentTable doctbl;
                    try {
                        doctbl = DocumentTableLoader.load(col, docName, _dynEnv);
                    } catch (IOException e) {
                        throw new XQRTException("failed to load document '" + docName
                                + "' is the collection '" + col.getAbsolutePath() + '\'', e);
                    }
                    final PagingProfile profile = doctbl.getPagingProfile();
                    Strategy origStrategy = null;
                    if(profile != null) {
View Full Code Here

TOP

Related Classes of xbird.xquery.XQRTException

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.