278279280281282283284285286
if (value == null) { throw new NumberFormatException("property " + name + " was null"); } Byte rc = (Byte) TypeConversionSupport.convert(value, Byte.class); if (rc == null) { throw new OpenwireException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a byte"); } return rc.byteValue(); }
290291292293294295296297298
if (value == null) { throw new NumberFormatException("property " + name + " was null"); } Short rc = (Short) TypeConversionSupport.convert(value, Short.class); if (rc == null) { throw new OpenwireException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a short"); } return rc.shortValue(); }
302303304305306307308309310
if (value == null) { throw new NumberFormatException("property " + name + " was null"); } Integer rc = (Integer) TypeConversionSupport.convert(value, Integer.class); if (rc == null) { throw new OpenwireException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as an integer"); } return rc.intValue(); }
314315316317318319320321322
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(); }
326327328329330331332333334
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(); }
338339340341342343344345346
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(); }
358359360361362363364365366
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; }
401402403404405406407408
setObjectProperty(name, value); } private void checkReadOnlyProperties() throws OpenwireException { if (readOnlyProperties) { throw new OpenwireException("Message properties are read-only"); } }
407408409410411412413414
} } protected void checkReadOnlyBody() throws OpenwireException { if (readOnlyBody) { throw new OpenwireException("Message body is read-only"); } }
105106107108109110111112
DataInputStream dataIn = new DataInputStream(is); map = MarshallingSupport.unmarshalPrimitiveMap(dataIn); dataIn.close(); } } catch (IOException e) { throw new OpenwireException(e); } }