Examples of DecodeException


Examples of javax.websocket.DecodeException

    private Object decodePrimitive(final Class<?> targetType, final String message) throws DecodeException {
        if (targetType == Boolean.class || targetType == boolean.class) {
            return Boolean.valueOf(message);
        } else if (targetType == Character.class || targetType == char.class) {
            if (message.length() > 1) {
                throw new DecodeException(message, "Character message larger than 1 character");
            }
            return Character.valueOf(message.charAt(0));
        } else if (targetType == Byte.class || targetType == byte.class) {
            return Byte.valueOf(message);
        } else if (targetType == Short.class || targetType == short.class) {
View Full Code Here

Examples of javax.websocket.DecodeException

                    }
                } else {
                    try {
                        return ((Decoder.BinaryStream) decoder).decode(new ByteArrayInputStream(bytes));
                    } catch (IOException e) {
                        throw new DecodeException(ByteBuffer.wrap(bytes), "Could not decode binary", e);
                    }
                }
            }
        }
        throw new DecodeException(ByteBuffer.wrap(bytes), "Could not decode binary");
    }
View Full Code Here

Examples of javax.websocket.DecodeException

        }

        @Override
        public EncodableObject decode(final String s) throws DecodeException {
            if(!initalized) {
                throw new DecodeException(s, "not initialized");
            }
            return new EncodableObject(s);
        }
View Full Code Here

Examples of javax.websocket.DecodeException

                    }
                } else {
                    try {
                        return ((Decoder.TextStream) decoder).decode(new StringReader(message));
                    } catch (IOException e) {
                        throw new DecodeException(message, "Could not decode string", e);
                    }
                }
            }
        }
        throw new DecodeException(message, "Could not decode string");
    }
View Full Code Here

Examples of javax.websocket.DecodeException

                    }
                } else {
                    try {
                        return ((Decoder.BinaryStream) decoder).decode(new ByteArrayInputStream(bytes));
                    } catch (IOException e) {
                        throw new DecodeException(ByteBuffer.wrap(bytes), "Could not decode binary", e);
                    }
                }
            }
        }
        throw new DecodeException(ByteBuffer.wrap(bytes), "Could not decode binary");
    }
View Full Code Here

Examples of javax.websocket.DecodeException

    {
        Pattern pat = Pattern.compile("([^|]*)|([^|]*)");
        Matcher mat = pat.matcher(s);
        if (!mat.find())
        {
            throw new DecodeException(s,"Unable to find Fruit reference encoded in text message");
        }

        Fruit fruit = new Fruit();
        fruit.name = mat.group(1);
        fruit.color = mat.group(2);
View Full Code Here

Examples of org.apache.qpid.proton.codec.DecodeException

            Discharge o = new Discharge();

            if(l.size() <= 0)
            {
                throw new DecodeException("The txn-id field cannot be omitted");
            }

            switch(2 - l.size())
            {
View Full Code Here

Examples of org.apache.qpid.proton.codec.DecodeException

            Declared o = new Declared();

            if(l.size() <= 0)
            {
                throw new DecodeException("The txn-id field cannot be omitted");
            }

            switch(1 - l.size())
            {
View Full Code Here

Examples of org.apache.qpid.proton.codec.DecodeException

            Detach o = new Detach();

            if(l.size() <= 0)
            {
                throw new DecodeException("The handle field cannot be omitted");
            }

            switch(3 - l.size())
            {
View Full Code Here

Examples of org.apache.qpid.proton.codec.DecodeException

            TransactionalState o = new TransactionalState();

            if(l.size() <= 0)
            {
                throw new DecodeException("The txn-id field cannot be omitted");
            }

            switch(2 - l.size())
            {
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.