312313314315316317318319320
if (value == null) { throw new NumberFormatException("property " + name + " was null"); } Long rc = (Long) TypeConversionSupport.convert(value, Long.class); if (rc == null) { throw new OpenwireException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a long"); } return rc.longValue(); }
324325326327328329330331332
if (value == null) { throw new NullPointerException("property " + name + " was null"); } Float rc = (Float) TypeConversionSupport.convert(value, Float.class); if (rc == null) { throw new OpenwireException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a float"); } return rc.floatValue(); }
336337338339340341342343344
if (value == null) { throw new NullPointerException("property " + name + " was null"); } Double rc = (Double) TypeConversionSupport.convert(value, Double.class); if (rc == null) { throw new OpenwireException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a double"); } return rc.doubleValue(); }
356357358359360361362363364
if (value == null) { return null; } String rc = (String) TypeConversionSupport.convert(value, String.class); if (rc == null) { throw new OpenwireException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a String"); } return rc; }
399400401402403404405406
setObjectProperty(name, value); } private void checkReadOnlyProperties() throws OpenwireException { if (readOnlyProperties) { throw new OpenwireException("Message properties are read-only"); } }
405406407408409410411412
} } protected void checkReadOnlyBody() throws OpenwireException { if (readOnlyBody) { throw new OpenwireException("Message body is read-only"); } }
104105106107108109110111
DataInputStream dataIn = new DataInputStream(is); map = MarshallingSupport.unmarshalPrimitiveMap(dataIn); dataIn.close(); } } catch (IOException e) { throw new OpenwireException(e); } }
133134135136137138139140
return ((Boolean)value).booleanValue(); } if (value instanceof String) { return Boolean.valueOf(value.toString()).booleanValue(); } else { throw new OpenwireException(" cannot read a boolean from " + value.getClass().getName()); } }
149150151152153154155156
return ((Byte)value).byteValue(); } if (value instanceof String) { return Byte.valueOf(value.toString()).byteValue(); } else { throw new OpenwireException(" cannot read a byte from " + value.getClass().getName()); } }
168169170171172173174175
return ((Byte)value).shortValue(); } if (value instanceof String) { return Short.valueOf(value.toString()).shortValue(); } else { throw new OpenwireException(" cannot read a short from " + value.getClass().getName()); } }