fieldMetadata.setLength(definition.getMaxLength());
if (definition.getDataDrivenEnumeration() != null && !CollectionUtils.isEmpty(definition.getDataDrivenEnumeration().getEnumValues())) {
int count = definition.getDataDrivenEnumeration().getEnumValues().size();
String[][] enumItems = new String[count][2];
for (int j = 0; j < count; j++) {
DataDrivenEnumerationValue item = definition.getDataDrivenEnumeration().getEnumValues().get(j);
enumItems[j][0] = item.getKey();
enumItems[j][1] = item.getDisplay();
}
fieldMetadata.setEnumerationValues(enumItems);
}
fieldMetadata.setName(definition.getName());
fieldMetadata.setFriendlyName(definition.getFriendlyName());