setMapEntryValue(mapEntryMetaData, parent, owner);
}
}
// the wildcard this element is a content of
WildcardBinding wildcard = null;
if(parentTerm != null && !parentTerm.isModelGroup())
{
ElementBinding parentElement = (ElementBinding)parentTerm;
TypeBinding parentType = parentElement.getType();
wildcard = parentType.getWildcard();
// there should be a better way of checking this
if(wildcard != null && parentType.getElement(qName) != null)
{
wildcard = null;
}
}
if(tryPut(owner, o, qName, term, trace))
{
}
else if(tryAdd(owner, o, qName, term, wildcard, trace))
{
}
else if (owner instanceof GenericValueContainer)
{
if (trace)
{
log.trace("setParent " + qName + " addChild");
}
((GenericValueContainer) owner).addChild(qName, o);
}
else if (owner instanceof Collection)
{
if (trace)
{
log.trace("setParent " + qName + " collection.add()");
}
((Collection<Object>) owner).add(o);
}
else
{
PropertyMetaData propertyMetaData = wildcard == null ? null : wildcard.getPropertyMetaData();
if (propertyMetaData == null)
{
propertyMetaData = term.getPropertyMetaData();
}