}
try{
//TODO if this is an EObject in template, this is not allowed!
parent.eSet(eReference, referencedElement);
} catch (Exception e){
throw new ValidationException(
"Couldn't set reference "
+eReference==null?"<!noReferenceName!>":eReference.getName()
+ " in "
+parent==null?"<!noEobjectSet!>":parent.eClass().getName()
+". Expected type is "
+ eReference==null?"<!noReferenceName!>":
eReference.getEType()==null?"<!noReferenceType!>":eReference.getEType().getName()
+ " but have "
+ referencedElement==null?"null":referencedElement.eClass().getName(),e);
}
set=true;
} else {
try{
referencedList.add(referencedElement);
} catch(Exception e){
throw new ValidationException(
"Couldn't add to reference " + referencedList.toString(),e);
}
}
}