String fieldName = typeDesc.getFieldNameForAttribute(attrQName);
if (fieldName == null)
continue;
// look for the attribute property
BeanPropertyDescriptor bpd =
(BeanPropertyDescriptor) propertyMap.get(fieldName);
if (bpd != null) {
if (!bpd.isWriteable() || bpd.isIndexed() ) continue ;
// determine the QName for this child element
TypeMapping tm = context.getTypeMapping();
Class type = bpd.getType();
QName qn = tm.getTypeQName(type);
if (qn == null)
throw new SAXException(
JavaUtils.getMessage("unregistered00", type.toString()));
// get the deserializer
Deserializer dSer = context.getDeserializerForType(qn);
if (dSer == null)
throw new SAXException(
JavaUtils.getMessage("noDeser00", type.toString()));
if (! (dSer instanceof SimpleDeserializer))
throw new SAXException(
JavaUtils.getMessage("AttrNotSimpleType00",
bpd.getName(),
type.toString()));
// Success! Create an object from the string and set
// it in the bean
try {
dSer.onStartElement(namespace, localName, qName, attributes, context);
Object val = ((SimpleDeserializer)dSer).
makeValue(attributes.getValue(i));
bpd.set(value, val);
} catch (Exception e) {
throw new SAXException(e);
}
} // if