if(owner != null) // todo: owner should never be null
{
if(owner instanceof MapEntry)
{
TypeBinding type = element.getType();
CharactersMetaData characters = type.getCharactersMetaData();
if(characters != null)
{
if(characters.isMapEntryKey())
{
((MapEntry)owner).setKey(value);
}
else if(characters.isMapEntryValue())
{
((MapEntry)owner).setValue(value);
}
else
{
throw new JBossXBRuntimeException("Parent object is a map entry but characters of element " +
qName +
" of type " +
type.getQName() +
" were bound to niether key nor value in a map entry."
);
}
}
else
{
throw new JBossXBRuntimeException("Parent object is a map entry but characters of element " +
qName +
" of type " +
type.getQName() +
" were bound to niether key nor value in a map entry."
);
}
}
else
{
String propName = null;
String colType = null;
TypeBinding type = element.getType();
if(type != null && !type.isSimple()/* && type.hasSimpleContent()*/)
{
PropertyMetaData propertyMetaData = type.getPropertyMetaData();
if(propertyMetaData == null)
{
CharactersMetaData charactersMetaData = type.getCharactersMetaData();
propertyMetaData = charactersMetaData == null ? null : charactersMetaData.getProperty();
}
if(propertyMetaData != null)
{
propName = propertyMetaData.getName();