if(prop != null)
valueElement = prop.getUnderlyingAnnotation(JBossXmlMapValueElement.class);
if(valueElement == null)
valueElement = propType.getUnderlyingAnnotation(JBossXmlMapValueElement.class);
JBossXmlMapValueAttribute valueAttribute = null;
if(prop != null)
valueAttribute = prop.getUnderlyingAnnotation(JBossXmlMapValueAttribute.class);
if(valueAttribute == null)
valueAttribute = propType.getUnderlyingAnnotation(JBossXmlMapValueAttribute.class);
TypeInfo keyType = propType.getKeyType();
TypeInfo valueType = propType.getValueType();
// entry handler
BeanAdapterFactory entryAdapterFactory = null;
BeanInfo entryInfo = JBossXBBuilder.configuration.getBeanInfo(DefaultMapEntry.class);
entryAdapterFactory = createAdapterFactory(DefaultBeanAdapterBuilder.class, entryInfo, null);
BeanHandler entryHandler = new BeanHandler(entryInfo.getName(), entryAdapterFactory);
TypeBinding entryType = null;
TypeInfo entryTypeInfo = null;
// bind the entry element if present
if(entryElement != null && !JBossXmlConstants.DEFAULT.equals(entryElement.name()))
{
String ns = entryElement.namespace();
if(JBossXmlConstants.DEFAULT.equals(ns))
ns = defaultNamespace;
QName entryName = new QName(ns, entryElement.name());
entryType = new TypeBinding();
entryType.setSchemaBinding(schemaBinding);
entryType.setHandler(entryHandler);
entryTypeInfo = JBossXBBuilder.configuration.getTypeInfo(DefaultMapEntry.class);
ElementBinding entryElementBinding = createElementBinding(entryTypeInfo, entryType, entryName, false);
ParticleBinding entryParticle = new ParticleBinding(entryElementBinding, 0, -1, true);
targetGroup.addParticle(entryParticle);
propertyQName = entryName;
if(keyAttribute != null)
{
TypeBinding attributeType = resolveTypeBinding(keyType);
AttributeHandler attributeHandler = new PropertyHandler(entryInfo.getProperty("key"), keyType);
String attrNs = keyAttribute.namespace();
if(JBossXmlConstants.DEFAULT.equals(attrNs))
attrNs = defaultNamespace;
AttributeBinding keyBinding = new AttributeBinding(schemaBinding, new QName(attrNs, keyAttribute.name()), attributeType, attributeHandler);
keyBinding.setRequired(true);
entryType.addAttribute(keyBinding);
}
if(valueAttribute != null)
{
TypeBinding attributeType = resolveTypeBinding(valueType);
AttributeHandler attributeHandler = new PropertyHandler(entryInfo.getProperty("value"), valueType);
String valueNs = valueAttribute.namespace();
if(JBossXmlConstants.DEFAULT.equals(valueNs))
valueNs = defaultNamespace;
AttributeBinding valueBinding = new AttributeBinding(schemaBinding, new QName(valueNs, valueAttribute.name()), attributeType, attributeHandler);
valueBinding.setRequired(true);
entryType.addAttribute(valueBinding);
}
else if(valueElement == null)
{