/** * @since 3.0 */ @SuppressWarnings({ "rawtypes", "unchecked" }) public void setValue(Object object, Object newValue) throws PropertyException { if (writeMethod == null) { throw new PropertyException("Property '" + propertyName + "' is not writable", this, object); } Class type = writeMethod.getParameterTypes()[0]; Converter<?> converter = ConverterFactory.factory.getConverter(type); try { newValue = (converter != null) ? converter.convert(newValue, type) : newValue; // this will take care of primitives. if (newValue == null) { newValue = this.nullValue; } writeMethod.invoke(object, newValue); } catch (Throwable th) { throw new PropertyException("Error writing property: " + propertyName, this, object, th); } } }