for (int i = 0; i < variableMappings.length; i++) {
VariableMappingType variableMapping = variableMappings[i];
String fieldName = variableMapping.getJavaVariableName().getStringValue().trim();
if (variableMapping.isSetXmlAttributeName()) {
AttributeDesc attributeDesc = new AttributeDesc();
attributeDesc.setFieldName(fieldName);
Class javaType = (Class) properties.get(fieldName);
if (javaType == null) {
throw new DeploymentException("field name " + fieldName + " not found in " + properties);
}
String attributeLocalName = variableMapping.getXmlAttributeName().getStringValue().trim();
QName xmlName = new QName("", attributeLocalName);
attributeDesc.setXmlName(xmlName);
SchemaLocalAttribute attribute = (SchemaLocalAttribute) attNameToType.get(attributeLocalName);
if (null == attribute) {
throw new DeploymentException("attribute " + xmlName + " not found in schema " + schemaType.getName());
}
attributeDesc.setXmlType(attribute.getType().getName());
fields[i] = attributeDesc;
} else {
ElementDesc elementDesc = new ElementDesc();
elementDesc.setFieldName(fieldName);