if(attr.getXTTClass().equals(Attribute.CLASS_SIMPLE)){
if(value instanceof SimpleNumeric && attr.getType().getBase().endsWith(Type.BASE_SYMBOLIC)){
// Add casting between symbolic and numeric if ordered
this.value = SimpleSymbolic.findInTheDomain((SimpleNumeric) value, attr.getType());
if(this.value == null){
throw new NotInTheDomainException(attr.getType().getDomain(), value,
"Setting value of attribute '"+attr.getName()+
"' for a value '"+value+"' that is not in the domain that is not 'Null'.");
}
}else if(value instanceof SimpleSymbolic && attr.getType().getBase().endsWith(Type.BASE_NUMERIC)){
this.value = SimpleSymbolic.findInTheDomain((SimpleNumeric) value, attr.getType());
if(this.value == null){
throw new NotInTheDomainException(attr.getType().getDomain(), value,
"Setting value of attribute '"+attr.getName()+
"' for a value '"+value+"' that is not in the domain that is not 'Null'.");
}
}else{
this.value = value;
}
}else if(attr.getXTTClass().equals(Attribute.CLASS_GENERAL)){
this.value = value;
}
}else{
throw new NotInTheDomainException(attr.getType().getDomain(), value,
"Setting value of attribute '"+attr.getName()+
"' for a value '"+value+"' that is not in the domain that is not 'Null'.");
}
}