Package javax.jms

Examples of javax.jms.MessageFormatException


        || obj instanceof Byte)
      return ((Number) obj).intValue();
    else if (obj == null || obj instanceof String)
      return (int) Long.parseLong((String) obj);
    else
      throw new MessageFormatException(L.l("can't convert '{0}' to int",
                                           obj.getClass().getName()));
  }
View Full Code Here


        || obj instanceof Byte)
      return ((Number) obj).longValue();
    else if (obj == null || obj instanceof String)
      return Long.parseLong((String) obj);
    else
      throw new MessageFormatException(L.l("can't convert '{0}' to long",
                                           obj.getClass().getName()));
  }
View Full Code Here

    if (obj == null || obj instanceof Float)
      return ((Number) obj).floatValue();
    else if (obj == null || obj instanceof String)
      return (float) Double.parseDouble((String) obj);
    else
      throw new MessageFormatException(L.l("can't convert '{0}' to float",
                                           obj.getClass().getName()));
  }
View Full Code Here

    if (obj == null || obj instanceof Float || obj instanceof Double)
      return ((Number) obj).doubleValue();
    else if (obj == null || obj instanceof String)
      return Double.parseDouble((String) obj);
    else
      throw new MessageFormatException(L.l("can't convert '{0}' to double",
                                           obj.getClass().getName()));
  }
View Full Code Here

    if (obj == null)
      return null;
    else if (! (obj instanceof byte[]))
      return obj.toString();
    else
      throw new MessageFormatException(L.l("can't convert '{0}' to String",
                                           obj.getClass().getName()));
  }
View Full Code Here

      return ((Character) obj).charValue();
    else if (obj instanceof String) {
      String s = (String) obj;

      if (s.length() != 1)
        throw new MessageFormatException(L.l("bad property {0}", obj));
       
      return s.charAt(0);
    }
    else
      throw new MessageFormatException(L.l("bad property {0}", obj));
   
  }
View Full Code Here

        throw new MessageFormatException(e.toString());
      }
    }
    */
    else
      throw new MessageFormatException(L.l("can't convert {0} to byte[]",
                                           obj.getClass().getName()));
  }
View Full Code Here

        {
            return Boolean.valueOf((String) o).booleanValue();
        }
        else if(getApplicationHeaders().containsKey(propertyName))
        {
            throw new MessageFormatException("getBooleanProperty(\""+propertyName+"\") failed as value is not boolean: " + o);
        }
        else
        {
            return Boolean.valueOf(null);
        }
View Full Code Here

        {
            return Byte.valueOf((String) o).byteValue();
        }
        else if(getApplicationHeaders().containsKey(propertyName))
        {
            throw new MessageFormatException("getByteProperty(\""+propertyName+"\") failed as value is not a byte: " + o);
        }
        else
        {
            return Byte.valueOf(null);
        }
View Full Code Here

            {
                return Short.valueOf(getByteProperty(propertyName));
            }
            catch(MessageFormatException e)
            {
                throw new MessageFormatException("getShortProperty(\""+propertyName+"\") failed as value is not a short: " + o);
            }
        }


    }
View Full Code Here

TOP

Related Classes of javax.jms.MessageFormatException

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.