}
public void saveState(IMemento memento) {
for (ConstraintData constraintData : constraintList) {
if (constraintData.getConstraint() instanceof SimpleRutaRuleConstraint) {
IMemento currentMemento = memento.createChild("constraint", "SimpleRutaConstraint");
SimpleRutaRuleConstraint constraint = (SimpleRutaRuleConstraint) constraintData
.getConstraint();
currentMemento.createChild("Data", constraint.getData());
currentMemento.createChild("Description", constraint.getDescription());
currentMemento.createChild("Weight", "" + constraintData.getWeight());
}
if (constraintData.getConstraint() instanceof RutaRuleListConstraint) {
IMemento currentMemento = memento.createChild("constraint", "ListRutaConstraint");
RutaRuleListConstraint constraint = (RutaRuleListConstraint) constraintData.getConstraint();
currentMemento.createChild("Data", constraint.getData());
currentMemento.createChild("Description", constraint.getDescription());
currentMemento.createChild("Weight", "" + constraintData.getWeight());
}
if (constraintData.getConstraint() instanceof RutaGEConstraint) {
IMemento currentMemento = memento.createChild("constraint", "GEConstraint");
RutaGEConstraint constraint = (RutaGEConstraint) constraintData.getConstraint();
currentMemento.createChild("Data", constraint.getData());
currentMemento.createChild("Description", constraint.getDescription());
currentMemento.createChild("Weight", "" + constraintData.getWeight());
}
}
}