return binding;
}
private static void bindAttributes(Context ctx, TypeBinding type, XSAttributeUse attrUse)
{
XSAttributeDeclaration attr = attrUse.getAttrDeclaration();
QName attrName = new QName(attr.getNamespace(), attr.getName());
if (ctx.trace)
{
log.trace("binding attribute " + attrName + " for " + type.getQName() + ", required=" + attrUse.getRequired());
}
XSSimpleTypeDefinition attrType = attr.getTypeDefinition();
TypeBinding typeBinding = bindSimpleType(ctx, attrType);
AttributeBinding binding = type.addAttribute(attrName, typeBinding, DefaultHandlers.ATTRIBUTE_HANDLER);
binding.setRequired(attrUse.getRequired());
if(attrUse.getConstraintType() == XSConstants.VC_DEFAULT)
{
// Associate the default value with the binding
binding.setDefaultConstraint(attrUse.getConstraintValue());
}
if (ctx.processAnnotations)
{
XSAnnotation an = attr.getAnnotation();
if(an != null)
{
if (ctx.trace)
{
log.trace(attrName + " attribute annotation");