// DebugInfo.debug("DmoCompactSchemaFormatter.setAttributeValues() " + cd.getName() + " is extensible");
// }
Iterator<String> attributeNames = obj.getAttributeNames();
while(attributeNames.hasNext()){
NamedStringArray attr = obj.get(attributeNames.next());
attrName = attr.getName();
if (attrName == null){
DebugInfo.debugWithTrace("Attr name null");
continue;
}
attrDef = sm.isAttribute(attrName);
if (attrDef == null){
ResultException ex = new ResultException();
ex.addError("Unknown attribute: " + attrName);
ex.result.lastResult().fileName(obj.getSV(MetaDMSAG.__file.name));
ex.result.lastResult().lineNumber(obj.lineNumber);
throw(ex);
}
StringBuffer attrNameCapped = new StringBuffer();
attrNameCapped.append(attrName);
attrNameCapped.setCharAt(0,Character.toUpperCase(attrNameCapped.charAt(0)));
if (cd.isAllowedAttribute(new StringName(attrName))){
if (attrDef.getValueType() == ValueTypeEnum.SINGLE){
String value = obj.getSV(attrName);
out.write(" _" + pf.sprintf(objName));
out.write(".set" + attrNameCapped + "(");
out.write("\"" + value + "\");\n");
}
else{
for(String value: attr){
out.write(" _" + pf.sprintf(objName));
out.write(".add" + attrNameCapped + "(");
out.write("\"" + value + "\");\n");
}
}
}
else{
// DebugInfo.debug("Extra attribute: " + attrName);
out.write(attrDef.getValueModificationStatement(uniqueNum," "," _" + objName, obj.get(attr.getName())));
uniqueNum++;
}
// if (attrDef.getValueType() == ValueTypeEnum.SINGLE)
// multiValued = false;