private static void bindAttributes(SchemaBinding doc,
TypeBinding type,
XSAttributeUse attrUse)
{
XSAttributeDeclaration attr = attrUse.getAttrDeclaration();
XSSimpleTypeDefinition attrType = attr.getTypeDefinition();
TypeBinding typeBinding = bindSimpleType(doc, attrType);
QName attrName = new QName(attr.getNamespace(), attr.getName());
AttributeBinding binding = type.addAttribute(attrName, typeBinding, RtAttributeHandler.INSTANCE);
if( attrUse.getConstraintType() == XSConstants.VC_DEFAULT )
{
// Associate the default value with the binding
binding.setDefaultConstraint(attrUse.getConstraintValue());
}
XSAnnotation an = attr.getAnnotation();
if(an != null)
{
XsdAnnotation xsdAn = XsdAnnotation.unmarshal(an.getAnnotationString());
XsdAppInfo appInfo = xsdAn.getAppInfo();
if(appInfo != null)
{
PropertyMetaData propertyMetaData = appInfo.getPropertyMetaData();
if(propertyMetaData != null)
{
binding.setPropertyMetaData(propertyMetaData);
}
boolean mapEntryKey = appInfo.isMapEntryKey();
if(mapEntryKey)
{
binding.setMapEntryKey(mapEntryKey);
}
boolean mapEntryValue = appInfo.isMapEntryValue();
if(mapEntryValue)
{
binding.setMapEntryValue(mapEntryValue);
}
}
}
if(log.isTraceEnabled())
{
String msg = "attribute " +
new QName(attr.getNamespace(), attr.getName()) +
": ";
if(binding.getPropertyMetaData() != null)
{
msg += " property=" +