Package xbird.xquery

Examples of xbird.xquery.XQRTException


    }

    @Override
    public int compareTo(Item trg) {
        if(!(trg instanceof XNumber)) {
            throw new XQRTException("err:XPTY0004", "Imcomparable "
                    + trg.getClass().getSimpleName() + " with " + this.getClass().getName());
        }
        final double thisValue = getNumber().doubleValue();
        final double trgValue = ((XNumber) trg).getNumber().doubleValue();
        return Double.compare(thisValue, trgValue);
View Full Code Here


            for(int i = 0; i < CACHE_SIZE; i++) {
                final long old;
                try {
                    old = pathIndexer.add(keys[i], values[i]);
                } catch (DbException e) {
                    throw new XQRTException("failed flushing PathIndexer. key: " + keys[i]
                            + ", value: " + values[i], e);
                }
                if(old != -1L) {
                    ++pathIdxDuplicates;
                }
View Full Code Here

            final byte[][] labels = labelValues;
            for(int i = 0; i < CACHE_SIZE; i++) {
                try {
                    labelIndexer.addValue(rowids[i], labels[i]);
                } catch (DbException e) {
                    throw new XQRTException("failed flushing PathIndexer. DTM_ROWID: " + rowids[i]
                            + ", LABEL: " + labels[i], e);
                }
            }
            labelIdxEntries += CACHE_SIZE;
            labelCachePtr = 0;
View Full Code Here

            for(int i = 0; i < pathCachePtr; i++) {
                final long old;
                try {
                    old = pathIndexer.add(keys[i], values[i]);
                } catch (DbException e) {
                    throw new XQRTException("failed flushing PathIndexer. key: " + keys[i]
                            + ", value: " + values[i], e);
                }
                if(old != -1L) {
                    ++pathIdxDuplicates;
                }
            }
            pathIdxEntries += pathCachePtr;
            pathCachePtr = 0;
        }
        if(labelCachePtr > 0) {
            final long[] rowids = labelKeys;
            final byte[][] labels = labelValues;
            for(int i = 0; i < labelCachePtr; i++) {
                try {
                    labelIndexer.addValue(rowids[i], labels[i]);
                } catch (DbException e) {
                    throw new XQRTException("failed flushing PathIndexer. DTM_ROWID: " + rowids[i]
                            + ", LABEL: " + labels[i], e);
                }
            }
            labelIdxEntries += labelCachePtr;
            labelCachePtr = 0;
        }

        try {
            pathIndexer.flush(true);
            //valueIndexer.flush(true);
            labelIndexer.flush(true, true);
        } catch (DbException dbe) {
            throw new XQRTException("failed flushing indexer", dbe);
        }

        docProps.setProperty(PATHS_IDX_ENTRIES + docName, String.valueOf(pathIdxEntries));
        docProps.setProperty(PATHS_IDX_DUPLICATES + docName, String.valueOf(pathIdxDuplicates));
        docProps.setProperty(PATHS_IDX_UNIQUES + docName, String.valueOf(pathIdxEntries
View Full Code Here

        writer.setXMLDeclaration(false);
        final SAXSerializer ser = new SAXSerializer(writer, sw);
        try {
            ser.emit(_citem);
        } catch (XQueryException e) {
            throw new XQRTException("eval failed!: " + e.getMessage());
        }
        return sw.toString();
    }
View Full Code Here

                factory.setNamespaceAware(true);
                SAXParser parser = factory.newSAXParser();
                myReader = parser.getXMLReader();
            }
        } catch (Exception e) {
            throw new XQRTException("Creating SAX XMLReader failed", e);
        }
        // setup handlers (requires saxHandler)
        myReader.setContentHandler(handler);
        try {
            myReader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
            myReader.setFeature("http://xml.org/sax/features/validation", true); // Validate the document and report validity errors.
            if(!parseAsHtml) {
                myReader.setFeature("http://apache.org/xml/features/validation/dynamic", true); // The parser will validate the document only if a grammar is specified.  
                myReader.setFeature("http://apache.org/xml/features/validation/schema", true); // Turn on XML Schema validation by inserting an XML Schema validator into the pipeline.  
            }
        } catch (Exception e) {
            throw new XQRTException("Configuaring SAX XMLReader failed.", e);
        }
        // setup entity resolver
        if(resolveEntity) {
            org.apache.xml.resolver.CatalogManager catalog = org.apache.xml.resolver.CatalogManager.getStaticManager();
            catalog.setIgnoreMissingProperties(true);
View Full Code Here

        public void writeExternal(ObjectOutput out) throws IOException {
            final XQEventEncoder encoder = new XQEventEncoder(out);
            try {
                encoder.emit(this);
            } catch (XQueryException xqe) {
                throw new XQRTException(xqe);
            } catch (Throwable e) {
                LOG.fatal(e);
                throw new IllegalStateException("failed encoding", e);
            }
        }
View Full Code Here

            final XQEventDecoder decoder = new XQEventDecoder(in);
            final Sequence<Item> decoded;
            try {
                decoded = decoder.decode();
            } catch (IOException ioe) {
                throw new XQRTException("decode failed", ioe);
            } catch (XQueryException xqe) {
                throw new XQRTException(xqe);
            } catch (Throwable e) {
                throw new IllegalStateException("decode failed", e);
            }
            this._toReplace = decoded;
        }
View Full Code Here

    }

    @Override
    public int compareTo(Item trg) {
        if(!(trg instanceof BooleanValue)) {
            throw new XQRTException("err:XPTY0004", "Imcomparable "
                    + trg.getClass().getSimpleName() + " with BooleanValue");
        }
        boolean trgValue = ((BooleanValue) trg)._value;
        return (trgValue == _value) ? 0 : (_value ? 1 : -1);
    }
View Full Code Here

            }
        }
        //  The typed-value of such an element is undefined.
        //  Attempting to access this property with the dm:typed-value accessor always raises
        //  an error.
        throw new XQRTException("The typed-value of such an element is undefined: " + t);
    }
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.