Package hprose.common

Examples of hprose.common.HproseException


            HproseHelper.uuidClass.equals(type)) {
            try {
                return HproseHelper.uuidFromString.invoke(null, new Object[] {s});
            }
            catch (Exception ex) {
                throw new HproseException(ex.getMessage());
            }
        }
        return castError(str, type);
    }
View Full Code Here


            HproseHelper.uuidClass.equals(type))) {
            try {
                return HproseHelper.uuidFromString.invoke(null, new Object[] {s});
            }
            catch (Exception ex) {
                throw new HproseException(ex.getMessage());
            }
        }
        return castError(buf, type);
    }
View Full Code Here

                Object value = unserialize(field.getType());
                try {
                    field.set(obj, value);
                }
                catch (Exception e) {
                    throw new HproseException(e.getMessage());
                }
            }
            else {
                unserialize();
            }
View Full Code Here

                Object value = unserialize(setter.getParameterTypes()[0]);
                try {
                    setter.invoke(obj, new Object[]{value});
                }
                catch (Exception e) {
                    throw new HproseException(e.getMessage());
                }
            }
            else {
                unserialize();
            }
View Full Code Here

                        Object value = unserialize(setter.getParameterTypes()[0]);
                        setter.invoke(obj, new Object[]{value});
                    }
                }
                catch (Exception e) {
                    throw new HproseException(e.getMessage());
                }
            }
            else {
                unserialize();
            }
View Full Code Here

                                Object value = unserialize(setter.getParameterTypes()[0]);
                                setter.invoke(obj, new Object[]{value});
                            }
                        }
                        catch (Exception e) {
                            throw new HproseException(e.getMessage());
                        }
                    }
                    else {
                        unserialize();
                    }
                }
            }
            else if (mode == HproseMode.FieldMode) {
                for (int i = 0; i < count; i++) {
                    Field field = (Field) members.get(memberNames[i]);
                    if (field != null) {
                        Object value = unserialize(field.getType());
                        try {
                            field.set(obj, value);
                        }
                        catch (Exception e) {
                            throw new HproseException(e.getMessage());
                        }
                    }
                    else {
                        unserialize();
                    }
                }
            }
            else {
                for (int i = 0; i < count; i++) {
                    PropertyAccessor pa = (PropertyAccessor) members.get(memberNames[i]);
                    if (pa != null) {
                        Method setter = pa.setter;
                        Object value = unserialize(setter.getParameterTypes()[0]);
                        try {
                            setter.invoke(obj, new Object[]{value});
                        }
                        catch (Exception e) {
                            throw new HproseException(e.getMessage());
                        }
                    }
                    else {
                        unserialize();
                    }
View Full Code Here

        }
        return castError(o, type);
    }

    private Object castError(String srctype, Class desttype) throws IOException {
        throw new HproseException(srctype + " can't change to " + desttype.getName());
    }
View Full Code Here

    private Object castError(String srctype, Class desttype) throws IOException {
        throw new HproseException(srctype + " can't change to " + desttype.getName());
    }

    private Object castError(Object obj, Class type) throws IOException {
        throw new HproseException(obj.getClass().getName() + " can't change to " + type.getName());
    }
View Full Code Here

                break;
            case HproseTags.TagError:
                readRaw(ostream);
                break;
            case -1:
                throw new HproseException("No byte found in stream");
            default:
                throw new HproseException("Unexpected serialize tag '" +
                        (char) tag + "' in stream");
        }
    }
View Full Code Here

                ostream.write(stream.read());
                ostream.write(stream.read());
                break;
            }
            default:
                throw new HproseException("bad utf-8 encoding at " +
                                          ((tag < 0) ? "end of stream" :
                                              "0x" + Integer.toHexString(tag & 0xff)));
        }
    }
View Full Code Here

TOP

Related Classes of hprose.common.HproseException

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.