public final static void setValue(final String expression, final Object object,
final Object value, final PropertyResolverConverter converter)
{
if (expression == null || expression.equals(""))
{
throw new WicketRuntimeException("Empty expression setting value: " + value +
" on object: " + object);
}
if (object == null)
{
throw new WicketRuntimeException(
"Attempted to set property value on a null object. Property expression: " +
expression + " Value: " + value);
}
ObjectAndGetSetter setter = getObjectAndGetSetter(expression, object, CREATE_NEW_VALUE);
if (setter == null)
{
throw new WicketRuntimeException("Null object returned for expression: " + expression +
" for setting value: " + value + " on: " + object);
}
setter.setValue(value, converter == null ? new PropertyResolverConverter(Application.get()
.getConverterLocator(), Session.get().getLocale()) : converter);
}