Package com.persistit.exception

Examples of com.persistit.exception.ConversionException


                if (_endArray != null && _endArray.length > TOO_MANY_LEVELS_THRESHOLD) {
                    _endArray = null;
                }
            }
            if (_size == 0) {
                throw new ConversionException("Value is undefined");
            }
            type = _bytes[_next++] & 0xFF;
            if (type >= CLASS1 && type <= CLASS5) {
                type = decodeVariableLengthInt(type) + CLASS1;
            } else if (type == Buffer.LONGREC_TYPE)
View Full Code Here


    private int nextType(final int expectedType) {
        final int type = nextType();
        if (type == expectedType || type == TYPE_NULL)
            return type;

        throw new ConversionException("Expected a " + classForHandle(expectedType) + " but value is a "
                + classForHandle(type));
    }
View Full Code Here

    private int nextType(final int expectedType1, final int expectedType2) {
        final int type = nextType();
        if (type == expectedType1 || type == expectedType2 || type == TYPE_NULL)
            return type;

        throw new ConversionException("Expected a " + classForHandle(expectedType1) + " but value is a "
                + classForHandle(type));
    }
View Full Code Here

    private Object getExpectedType(final Class<?> type) {
        final Object object = get(null, null);
        if (object == null || type.isAssignableFrom(object.getClass())) {
            return object;
        } else {
            throw new ConversionException("Expected a " + type.getName() + " but value is a "
                    + object.getClass().getName());
        }
    }
View Full Code Here

    private int handleForIndexedClass(final Class<?> cl) {
        final ClassInfo ci = _persistit.getClassIndex().lookupByClass(cl);
        if (ci != null) {
            return ci.getHandle();
        }
        throw new ConversionException("Class not mapped to handle " + cl.getName());
    }
View Full Code Here

    }

    private ClassInfo classInfoForHandle(final int classHandle) {
        final ClassInfo classInfo = _persistit.getClassIndex().lookupByHandle(classHandle);
        if (classInfo == null) {
            throw new ConversionException("Unknown class handle " + classHandle);
        }
        return classInfo;
    }
View Full Code Here

        final char ch = (char) (_bytes[index] & 0xFF);
        if (ch == TRUE_CHAR)
            return true;
        if (ch == FALSE_CHAR)
            return false;
        throw new ConversionException("Expected a Boolean " + " but value " + ch + " is neither 'T' nor 'F' at index="
                + index);
    }
View Full Code Here

            _next = start;
            final Object array = get(null, null);
            if (array == null || array.getClass().isArray()) {
                return array;
            } else {
                throw new ConversionException("Referenced object is not an array");
            }
        }
        Object result;
        try {
            _depth++;
View Full Code Here

                    else
                        return new ValueObjectInputStream(value);
                }
            });
        } catch (final PrivilegedActionException pae) {
            throw new ConversionException("While creating "
                    + (output ? "ValueObjectOutputStream" : "ValueObjectInputStream"), pae.getException());
        }
    }
View Full Code Here

        }

        @Override
        public void defaultReadObject() {
            if (_value._currentCoder == null || _value._currentObject == null) {
                throw new ConversionException("not in call to readObject");
            }
            _value._currentCoder.renderDefaultFields(_value, _value._currentObject);
        }
View Full Code Here

TOP

Related Classes of com.persistit.exception.ConversionException

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.