Package xbird.xquery

Examples of xbird.xquery.DynamicError


        } else {
            final String sv = LongType.LONG.processWhitespace(it.stringValue());
            if(StringUtils.isNumber(sv)) {
                l = Long.parseLong(sv);
            } else {
                throw new DynamicError("err:FORG0001", "Illegal value for xs:long: " + sv);
            }
        }
        return l;
    }
View Full Code Here


                output.writeByte(EV_NODE_START);
                dm.export(node, this);
                output.writeByte(EV_NODE_END);
            }
        } catch (IOException e) {
            throw new DynamicError("failed on evNode", e);
        }
    }
View Full Code Here

        } else {
            final String sv = FloatType.FLOAT.processWhitespace(it.stringValue());
            if(StringUtils.isNumber(sv)) {
                f = Float.parseFloat(sv);
            } else {
                throw new DynamicError("err:FORG0001", "Illegal value for xs:long: " + sv);
            }
        }
        return f;
    }
View Full Code Here

    public void evAtomicValue(AtomicValue atom) throws XQueryException {
        try {
            output.writeByte(EV_ATOM);
            AtomicValue.writeAtomicValue(atom, output); // tiny hack: output.writeObject(atom);
        } catch (IOException e) {
            throw new DynamicError("failed to write an atomic-value: " + atom, e);
        }
    }
View Full Code Here

            output.writeByte(EV_END_ITEM);
            if(last) {
                output.writeByte(EV_EOF);
            }
        } catch (IOException e) {
            throw new DynamicError("failed on endItem", e);
        }
    }
View Full Code Here

        } else {
            final String sv = DecimalType.DECIMAL.processWhitespace(it.stringValue());
            if(StringUtils.isNumber(sv)) {
                d = new BigDecimal(sv);
            } else {
                throw new DynamicError("err:FORG0001", "Illegal value for xs:long: " + sv);
            }
        }
        return d;
    }
View Full Code Here

        public static long addL(final long a, final long b) throws DynamicError {
            final long sum = a + b;
            if(a < 0 && b < 0) {
                if(sum > 0) {
                    throw new DynamicError("err:FOAR0002", "long overflows: " + a + " + " + b
                            + " = " + sum);
                }
            } else if(a > 0 && b > 0) {
                if(sum < 0) {
                    throw new DynamicError("err:FOAR0002", "long overflows: " + a + " + " + b
                            + " = " + sum);
                }
            }
            return sum;
        }
View Full Code Here

        public static long subtractL(final long a, final long b) throws DynamicError {
            final long surplus = a - b;
            if(a < 0 && b > 0) {
                if(surplus > 0) {
                    throw new DynamicError("err:FOAR0002", "long overflows: " + a + " - " + b
                            + " = " + surplus);
                }
            } else if(a > 0 && b < 0) {
                if(surplus < 0) {
                    throw new DynamicError("err:FOAR0002", "long overflows: " + a + " - " + b
                            + " = " + surplus);
                }
            }
            return surplus;
        }
View Full Code Here

                return 0L;
            }
            final long product = a * b;
            final long b2 = product / a;
            if(b2 != b) {
                throw new DynamicError("err:FOAR0002", "long overflows: " + a + " * " + b + " = "
                        + product);
            }
            return product;
        }
View Full Code Here

        @Deprecated
        public static long divideL(final long a, final long b) throws DynamicError {
            final long divided = a / b;
            final long a2 = divided * b;
            if(a2 != a) {
                throw new DynamicError("err:FOAR0002", "long overflows: " + a + " / " + b + " = "
                        + divided);
            }
            return divided;
        }
View Full Code Here

TOP

Related Classes of xbird.xquery.DynamicError

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.