Examples of MessageTypeException


Examples of org.msgpack.MessageTypeException

            return null;
        }
        // TODO #MN
        Template<Object> tmpl = registry.tryLookup(lookupType);
        if (tmpl == this || tmpl == null) {
            throw new MessageTypeException("Template lookup fail: " + lookupType);
        }
        return tmpl.read(u, to);
    }
View Full Code Here

Examples of org.msgpack.MessageTypeException

    }

    public void write(Packer pk, Collection<E> target, boolean required) throws IOException {
        if (target == null) {
            if (required) {
                throw new MessageTypeException("Attempted to write null");
            }
            pk.writeNil();
            return;
        }
        Collection<E> col = target;
View Full Code Here

Examples of org.msgpack.MessageTypeException

    }

    @Override
    void acceptUnsignedInteger(long v) {
        if(v < 0L) {
            throw new MessageTypeException()// TODO message
        }
        this.value = v;
    }
View Full Code Here

Examples of org.msgpack.MessageTypeException

    }

    @Override
    public void writeArrayEnd(boolean check) {
        if(!stack.topIsArray()) {
            throw new MessageTypeException("writeArrayEnd() is called but writeArrayBegin() is not called");
        }

        int remain = stack.getTopCount();
        if(remain > 0) {
            if(check) {
                throw new MessageTypeException("writeArrayEnd(check=true) is called but the array is not end");
            }
            for(int i=0; i < remain; i++) {
                writeNil();
            }
        }
View Full Code Here

Examples of org.msgpack.MessageTypeException

    }

    @Override
    public void writeMapEnd(boolean check) {
        if(!stack.topIsMap()) {
            throw new MessageTypeException("writeMapEnd() is called but writeMapBegin() is not called");
        }

        int remain = stack.getTopCount();
        if(remain > 0) {
            if(check) {
                throw new MessageTypeException("writeMapEnd(check=true) is called but the map is not end");
            }
            for(int i=0; i < remain; i++) {
                writeNil();
            }
        }
View Full Code Here

Examples of org.msgpack.MessageTypeException

    private DoubleArrayTemplate() { }

    public void write(Packer pk, double[] target, boolean required) throws IOException {
        if (target == null) {
            if (required) {
                throw new MessageTypeException("Attempted to write null");
            }
            pk.writeNil();
            return;
        }
        pk.writeArrayBegin(target.length);
View Full Code Here

Examples of org.msgpack.MessageTypeException

    private FloatTemplate() { }

    public void write(Packer pk, Float target, boolean required) throws IOException {
        if (target == null) {
            if (required) {
                throw new MessageTypeException("Attempted to write null");
            }
            pk.writeNil();
            return;
        }
        pk.writeFloat(target);
View Full Code Here

Examples of org.msgpack.MessageTypeException

    }

    @Override
    void acceptInteger(long v) {
        if(value < (long)Integer.MIN_VALUE || value > (long)Integer.MAX_VALUE) {
            throw new MessageTypeException()// TODO message
        }
        this.value = (int)v;
    }
View Full Code Here

Examples of org.msgpack.MessageTypeException

    }

    @Override
    void acceptUnsignedInteger(int v) {
        if(v < 0) {
            throw new MessageTypeException()// TODO message
        }
        this.value = v;
    }
View Full Code Here

Examples of org.msgpack.MessageTypeException

    }

    @Override
    void acceptUnsignedInteger(long v) {
        if(v < 0 || v > (long)Integer.MAX_VALUE) {
            throw new MessageTypeException()// TODO message
        }
        this.value = (int)v;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.