Package com.persistit.exception

Examples of com.persistit.exception.ConversionException


                            final String name = osFields[index].getName();
                            try {
                                field = clientClass.getDeclaredField(name);
                                list.add(field);
                            } catch (final NoSuchFieldException nsfe) {
                                throw new ConversionException(clientClass + " unmatched serializable field '" + name
                                        + "' declared");
                            }
                        }
                    } else {
                        final Field[] fields = clientClass.getDeclaredFields();
View Full Code Here


        _serializable = Serializable.class.isAssignableFrom(clientClass);
        if (_serializable) {
            _externalizable = Externalizable.class.isAssignableFrom(clientClass);
            _classDescriptor = ObjectStreamClass.lookup(_clazz);
        } else if (mustBeSerializable) {
            throw new ConversionException("Not Serializable: " + clientClass.getName());
        }

        final Class superClass = clientClass.getSuperclass();
        if (superClass != null && Serializable.class.isAssignableFrom(superClass)) {
            ValueCoder coder = null;
View Full Code Here

                    try {
                        constructor = _clazz.getDeclaredConstructor(EMPTY_CLASS_ARRAY);
                    } catch (final NoSuchMethodException nsme) {
                    }
                    if (_externalizable && (constructor == null || !Modifier.isPublic(constructor.getModifiers()))) {
                        throw new ConversionException("Externalizable class " + _clazz.getName()
                                + " requires a public no-argument constructor");
                    } else if (constructor == null) {
                        throw new ConversionException("Class " + _clazz.getName()
                                + " requires a no-argument constructor");
                    }
                    constructor.setAccessible(true);
                    _newInstanceConstructor = constructor;
                } else {
View Full Code Here

        }
        if (object instanceof Externalizable) {
            try {
                ((Externalizable) object).writeExternal(value.getObjectOutputStream());
            } catch (final Exception e) {
                throw new ConversionException("Invoking writeExternal for " + _clazz, e);
            }
        } else if (_writeObjectMethod != null) {
            invokeMethod(value, _writeObjectMethod, object, new Object[] { value.getObjectOutputStream() }, true);
        } else {
            putDefaultFields(value, object);
View Full Code Here

        value.setCurrentObject(setStackFields ? object : null);
        try {
            final Object result = method.invoke(object, args);
            return result;
        } catch (final Exception e) {
            throw new ConversionException("Invoking " + method + " for " + _clazz, e);
        } finally {
            value.setCurrentCoder(saveCoder);
            value.setCurrentObject(saveObject);
        }
    }
View Full Code Here

            final boolean setStackFields) throws ConversionException {
        try {
            final Object result = method.invoke(object, args);
            return result;
        } catch (final Exception e) {
            throw new ConversionException("Invoking " + method + " for " + _clazz, e);
        }
    }
View Full Code Here

                return _newInstanceMethod.invoke(_classDescriptor, _newInstanceArguments);
            } else {
                return _clazz.newInstance();
            }
        } catch (final Exception e) {
            throw new ConversionException("Instantiating " + _clazz.getName(), e);

        }
    }
View Full Code Here

            for (int index = 0; index < accessors.length; index++) {
                accessor = accessors[index];
                accessors[index].toValue(object, value);
            }
        } catch (final Exception e) {
            throw new ConversionException("Encoding " + accessor.toString() + " for " + _clazz, e);
        }
    }
View Full Code Here

        if (target instanceof Externalizable) {
            try {
                ((Externalizable) target).readExternal(value.getObjectInputStream());
            } catch (final Exception e) {
                throw new ConversionException("Invoking readExternal for " + _clazz, e);
            }
        } else if (_readObjectMethod != null) {
            invokeMethod(value, _readObjectMethod, target, new Object[] { value.getObjectInputStream() }, true);
        } else {
            renderDefaultFields(value, target);
View Full Code Here

            for (int index = 0; index < accessors.length; index++) {
                accessor = accessors[index];
                accessor.fromValue(target, value);
            }
        } catch (final Exception e) {
            throw new ConversionException("Decoding " + accessor.toString() + " for " + _clazz, e);
        }
    }
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.