{
attribute = getValueFrom(field, current);
}
catch (Exception e)
{
throw new MetadataException("Can't read field '" + field.getName() + "' of type " + field.getType().getName(), e);
}
if (attribute != null || value != null)
{
// if the intermediary nested object is null, we have to create
// a new instance to set the value
if (attribute == null)
{
try
{
attribute = ClassHelper.newInstance(field.getType());
}
catch (Exception e)
{
throw new MetadataException("Can't create nested object of type '"
+ field.getType() + "' for field '"
+ field.getName() + "'", e);
}
}
try
{
//field.set(current, attribute);
setValueFor(field, current, attribute);
}
//catch (IllegalAccessException e)
catch (Exception e)
{
throw new MetadataException("Can't set nested object of type '"
+ field.getType() + "' for field '"
+ field.getName() + "'", e);
}
}
else