public void attributes(Object o, QName elementName, TypeBinding type, Attributes attrs, NamespaceContext nsCtx)
{
for(int i = 0; i < attrs.getLength(); ++i)
{
QName qName = new QName(attrs.getURI(i), attrs.getLocalName(i));
AttributeBinding binding = type.getAttribute(qName);
if(binding != null)
{
AttributeHandler handler = binding.getHandler();
Object value = handler.unmarshal(elementName, qName, binding, nsCtx, attrs.getValue(i));
handler.attribute(elementName, qName, binding, o, value);
}
else if(!Constants.NS_XML_SCHEMA_INSTANCE.equals(qName.getNamespaceURI()))
{
SchemaBinding schemaBinding = type.getSchemaBinding();
if(schemaBinding != null && schemaBinding.isStrictSchema())
{
throw new JBossXBRuntimeException(
"Attribute is not bound: element owner " + elementName + ", attribute " + qName
);
}
else if(log.isTraceEnabled())
{
log.trace("Attribute is not bound: element owner " + elementName + ", attribute " + qName);
}
}
}
}
}