}
if ("description".equals(fieldName) == true) {
return true;
}
final GanttTask ganttObject = (GanttTask) obj;
final TaskDO task = taskTree.getTaskById((Integer) ganttObject.getId());
if (task != null) {
if ("predecessor".equals(field.getName()) == true) {
// Predecessor unmodified?
return NumberHelper.isEqual((Integer) ganttObject.getPredecessorId(), task.getGanttPredecessorId());
}
String taskFieldname = fieldMapping.get(fieldName);
if (taskFieldname == null) {
taskFieldname = fieldName;
}
for (final Field taskField : taskFields) {
if (taskFieldname.equals(taskField.getName()) == true) {
final Object value = BeanHelper.getFieldValue(obj, field);
final Object taskValue = BeanHelper.getFieldValue(task, taskField);
if (value instanceof BigDecimal) {
// Needed, because 10.0 is not equal to 10.000 (if scale is different).
return NumberHelper.isEqual((BigDecimal) value, (BigDecimal) taskValue);
}
return ObjectUtils.equals(value, taskValue) == true;
}
}
}
}
return false;
}
@Override
protected void writeField(final Field field, final Object obj, final Object fieldValue, final XmlField annotation,
final Element element)
{
if (GanttTask.class.isAssignableFrom(field.getDeclaringClass()) == true) {
final String fieldName = field.getName();
if ("id".equals(fieldName) == false) {
final TaskTree taskTree = taskDao.getTaskTree();
final GanttTask ganttObject = (GanttTask) obj;
final TaskDO task = taskTree.getTaskById((Integer) ganttObject.getId());
if (task != null) {
String taskFieldname = fieldMapping.get(fieldName);
if (taskFieldname == null) {
taskFieldname = fieldName;
}