|
Re: [EMF compare] ignore the comparison of an attribute by its value [message #667821 is a reply to message #667200] |
Mon, 02 May 2011 10:57 |
|
Not easily, but it can be done. Basically, you need to override the two "checkAttributesUpdates" methods, copy/paste the code from the generic "AttributesCheck" and replace the call to "shouldBeIgnored" (the line "if (!shouldBeIgnored(next)) {" by a call to your own "shouldBeIgnored" that takes both the EAttribute and the MatchElement as parameter in order to retrieve the attribute value for that given Match2/3Elements.
Something like
protected void shouldBeIgnored(EAttribute attribute, Match2Elements mapping) {
boolean result = shouldBeIgnored(next));
if (!result) {
Object leftValue = mapping.getLeftElement().eGet(attribute);
Object rightValue = mapping.getRightElement().eGet(attribute);
result = leftValue.equals("ignoreMe") || rightValue.equals("ignoreMe");
}
return result;
}
Laurent Goubet
Obeo
|
|
|
Powered by
FUDForum. Page generated in 0.01783 seconds