ClassRep clsRep = types.getBeanBuilder().build(javaType);
// Write out fields
Vector fields = clsRep.getFields();
for (int i=0; i < fields.size(); i++) {
FieldRep field = (FieldRep) fields.elementAt(i);
String name = field.getName();
if (typeDesc != null) {
FieldDesc fieldDesc = typeDesc.getFieldByName(field.getName());
if (fieldDesc != null) {
if (!fieldDesc.isElement()) {
QName attrName = typeDesc.getAttributeNameForField(
field.getName());
writeAttribute(types, attrName.getLocalPart(),
field.getType(),
complexType);
continue;
} else {
QName xmlName = typeDesc.getElementNameForField(
field.getName());
if (xmlName != null) {
if (xmlName.getNamespaceURI() != "") {
// Throw an exception until we can emit
// schema for this correctly?
}
name = xmlName.getLocalPart();
writeField(types, name, field.getType(),
field.getIndexed(), all);
continue;
}
}
}
}
writeField(types, name, field.getType(), field.getIndexed(), all);
}
// done
return true;
}