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); } }
134135136137138139140141
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()); } }
150151152153154155156157
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()); } }
169170171172173174175176
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()); } }