use of com.revolsys.datatype.EnumerationDataType in project com.revolsys.open by revolsys.
the class OsnSerializer method serializeAttributes.
public void serializeAttributes(final Record object) throws IOException {
final RecordDefinition type = object.getRecordDefinition();
final int attributeCount = type.getFieldCount();
for (int i = 0; i < attributeCount; i++) {
final Object value = object.getValue(i);
if (value != null) {
final String name = type.getFieldName(i);
final DataType dataType = type.getFieldType(i);
if (dataType instanceof EnumerationDataType) {
fieldName(name);
write(value.toString());
endAttribute();
} else {
serializeAttribute(name, value);
}
if (this.indentEnabled) {
endLine();
}
if (!this.endElement) {
if (i < attributeCount - 1) {
endLine();
} else if (type.getName().equals("/Coord3D")) {
for (final Object parent : this.scope) {
if (parent instanceof Record) {
final Record parentObject = (Record) parent;
if (parentObject.getRecordDefinition().getName().equals(SaifConstants.TEXT_ON_CURVE)) {
endLine();
}
}
}
} else {
endLine();
}
}
}
}
}
Aggregations