MetaType mapValueType = mapType.getValueType();
MapCompositeValueSupport result = new MapCompositeValueSupport(mapValueType);
for(Entry<String,?> entry : map.entrySet())
{
Object entryValue = entry.getValue();
MetaValue entryMetaValue = internalCreate(entryValue, null, mapValueType);
result.put(entry.getKey(), entryMetaValue);
}
mapping.put(value, result);
return result;
}
CompositeValueSupport result = new CompositeValueSupport(type);
mapping.put(value, result);
BeanInfo beanInfo;
try
{
ClassLoader cl = value.getClass().getClassLoader();
if (cl == null)
beanInfo = configuration.getBeanInfo(value.getClass());
else
beanInfo = configuration.getBeanInfo(type.getTypeName(), cl);
}
catch (Exception e)
{
throw new RuntimeException("Error retrieving BeanInfo for " + type, e);
}
for (String name : type.itemSet())
{
MetaType itemType = type.getType(name);
Object itemValue = null;
try
{
PropertyInfo property = beanInfo.getProperty(name);
if (property.isReadable())
itemValue = beanInfo.getProperty(value, name);
}
catch (RuntimeException e)
{
throw e;
}
catch (Error e)
{
throw e;
}
catch (Throwable t)
{
throw new RuntimeException("Error getting property: " + name + " for " + value.getClass(), t);
}
MetaValue item = internalCreate(itemValue, null, itemType);
result.set(name, item);
}
return result;
}