return result;
}
private static ComplexDataType clone(ComplexDataType complexValue) {
if (complexValue instanceof DataGrid) {
final DataGrid dataGrid = (DataGrid) complexValue;
DataGrid result = new DataGrid();
for (final DataGridRow dataGridRow : dataGrid.getRows()) {
final DataGridRow rowClone = new DataGridRow();
rowClone.setIndex(dataGridRow.getIndex());
for (final DataGridField dataGridField : dataGridRow.getFields()) {
final DataGridField fieldClone = new DataGridField();
fieldClone.setName(dataGridField.getName());
fieldClone.setValue(dataGridField.getValue());
rowClone.getFields().add(fieldClone);
}
result.getRows().add(rowClone);
}
return result;
}
return null;
}