|
|
|
Re: Set equality helper [message #1196098 is a reply to message #1194221] |
Tue, 19 November 2013 08:43 |
|
Indeed, we forgot to update this example when we changed that API. The means are still the same : you need to change the equality helper. However changing the equality helper should now be done through a factory. We'll update the FAQ example, for now you should be able to build from this other example; what you need to alter in this one is the "DefaultEqualityHelperFactory" : you'll need your own sub-class of that.
Basically, something of the sort:
IComparisonFactory comparisonFactory = new DefaultComparisonFactory(new DefaultEqualityHelperFactory() {
public IEqualityHelper createEqualityHelper() {
return new MyEqualityHelper();
}
});
IEObjectMatcher matcher = DefaultMatchEngine.createDefaultEObjectMatcher(UseIdentifiers.WHEN_AVAILABLE);
IMatchEngine customMatchEngine = new DefaultMatchEngine(matcher, comparisonFactory);
IMatchEngine.Factory engineFactory = new MatchEngineFactoryImpl() {
public IMatchEngine getMatchEngine() {
return customMatchEngine;
}
};
engineFactory.setRanking(20); // default engine ranking is 10, must be higher to override.
registry.add(engineFactory);
EMFCompare.builder().setMatchEngineFactoryRegistry(registry).build().compare(scope);
Laurent Goubet
Obeo
|
|
|
Powered by
FUDForum. Page generated in 0.05989 seconds