AttributeHandler attributeHandler = new PropertyHandler(property, attributeTypeInfo);
// Create the attributre and bind it to the type
AttributeBinding attribute = new AttributeBinding(schemaBinding, qName, attributeType, attributeHandler);
attribute.setRequired(xmlAttribute.required());
typeBinding.addAttribute(attribute);
JBossXmlPreserveWhitespace preserveSpace = property.getUnderlyingAnnotation(JBossXmlPreserveWhitespace.class);
if(preserveSpace != null)
attribute.setNormalizeSpace(preserveSpace.preserve() ? false : true);
if (trace)
log.trace("Bound attribute " + qName + " type=" + beanInfo.getName() + " property=" + property.getName() + " propertyType=" + attributeTypeInfo + ", normalizeSpace=" + attribute.isNormalizeSpace());
}
// Is this any attribute
XmlAnyAttribute xmlAnyAttribute = property.getUnderlyingAnnotation(XmlAnyAttribute.class);
if (xmlAnyAttribute != null)
{
if (seenXmlAnyAttribute != null)
throw new RuntimeException("@XmlAnyAttribute seen on two properties: " + property.getName() + " and " + seenXmlAnyAttribute.getName());
seenXmlAnyAttribute = property;
AnyAttributePropertyHandler anyHandler = new AnyAttributePropertyHandler(property, property.getType());
AnyAttributeBinding anyAttribute = new AnyAttributeBinding(schemaBinding, anyHandler);
typeBinding.setAnyAttribute(anyAttribute);
JBossXmlPreserveWhitespace preserveSpace = property.getUnderlyingAnnotation(JBossXmlPreserveWhitespace.class);
if(preserveSpace != null)
anyAttribute.setNormalizeSpace(preserveSpace.preserve() ? false : true);
if (trace)
log.trace("Bound any attribute type=" + beanInfo.getName() + " property=" + property.getName() + ", normalizeSpace=" + anyAttribute.isNormalizeSpace());
}
// Are we determining the property order?