public void handle(PropertyInfo propertyInfo, TypeInfo propertyType, Object parent, Object child, QName qName)
{
if(trace)
log.trace("handle entry " + qName + ", property=" + propertyInfo.getName() + ", parent=" + parent + ", child=" + child);
BeanAdapter beanAdapter = (BeanAdapter) parent;
Map<Object, Object> m = null;
if(mapFactory == null)
{
// it's wrapped, so the parent expected to be a map
m = (Map<Object, Object>) beanAdapter.getValue();
}
else
{
try
{
if (propertyInfo.getGetter() != null)
m = (Map<Object, Object>) beanAdapter.get(propertyInfo);
}
catch (Throwable t)
{
throw new RuntimeException("QName " + qName + " error getting map property " + propertyInfo.getName()
+ " for " + BuilderUtil.toDebugString(parent), t);
}
// No map so create one
if (m == null)
{
try
{
m = mapFactory.createMap();
}
catch (Throwable t)
{
throw new RuntimeException("QName " + qName + " error creating map: " + propertyType.getName(), t);
}
try
{
beanAdapter.set(propertyInfo, m);
}
catch (Throwable t)
{
throw new RuntimeException("QName " + qName + " error setting map property " + propertyInfo.getName()
+ " for " + BuilderUtil.toDebugString(parent) + " with value " + BuilderUtil.toDebugString(m), t);