{
log.warn("Neither getter/setter nor field were found for field " + prop + " in " + cls);
return;
}
throw new JBossXBRuntimeException(
"Neither getter/setter nor field were found for field " + prop + " in " + cls
);
}
}
if(colType != null ||
// todo collections of collections
Collection.class.isAssignableFrom(fieldType) &&
!Collection.class.isAssignableFrom(value.getClass()))
{
Collection col = (Collection)get(o, getter, field);
if(col == null)
{
if(colType == null)
{
col = new ArrayList();
}
else
{
Class colCls;
try
{
colCls = Thread.currentThread().getContextClassLoader().loadClass(colType);
}
catch(ClassNotFoundException e)
{
throw new JBossXBRuntimeException("Failed to load collection type: " + colType);
}
try
{
col = (Collection)colCls.newInstance();
}
catch(Exception e)
{
throw new JBossXBRuntimeException("Failed to create an instance of " + colCls);
}
}
set(o, col, setter, field);
}