本文整理汇总了Java中org.eclipse.emf.compare.match.IMatchEngine类的典型用法代码示例。如果您正苦于以下问题:Java IMatchEngine类的具体用法?Java IMatchEngine怎么用?Java IMatchEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMatchEngine类属于org.eclipse.emf.compare.match包,在下文中一共展示了IMatchEngine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initMatchEngine
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
/**
* Initialize and configure the match engines to be used.
*
* @param packageIgnoreChecker
* The package ignore checker to use in the match engine.
* @param diffingOptions
* The options configuring the comparison.
*
* @return The registry containing all prepared match engines
*/
private IMatchEngine.Factory.Registry initMatchEngine(PackageIgnoreChecker packageIgnoreChecker,
Map<String, String> diffingOptions) {
SimilarityChecker similarityChecker = initSimilarityChecker(diffingOptions);
IEqualityHelper equalityHelper = initEqualityHelper(similarityChecker);
EqualityStrategy equalityStrategy = new JaMoPPEqualityStrategy(similarityChecker);
IgnoreStrategy ignoreStrategy = new JaMoPPIgnoreStrategy(packageIgnoreChecker);
StrategyResourceMatcher resourceMatcher = initResourceMatcher(diffingOptions);
IMatchEngine.Factory matchEngineFactory = new HierarchicalMatchEngineFactory(equalityHelper, equalityStrategy,
ignoreStrategy, resourceMatcher);
matchEngineFactory.setRanking(20);
IMatchEngine.Factory.Registry matchEngineRegistry = new MatchEngineFactoryRegistryImpl();
matchEngineRegistry.add(matchEngineFactory);
return matchEngineRegistry;
}
开发者ID:kopl,项目名称:SPLevo,代码行数:29,代码来源:JaMoPPDiffer.java
示例2: setupComparator
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
/**
* setups a default emf comparator. This is just copy & paste from the
* EMFCompare tutorial.
*
* @return default emf comparator.
*/
private EMFCompare setupComparator() {
IEObjectMatcher matcher = DefaultMatchEngine
.createDefaultEObjectMatcher(UseIdentifiers.NEVER);
IComparisonFactory comparisonFactory = new DefaultComparisonFactory(
new DefaultEqualityHelperFactory());
IMatchEngine.Factory matchEngineFactory = new MatchEngineFactoryImpl(
matcher, comparisonFactory);
matchEngineFactory.setRanking(20);
IMatchEngine.Factory.Registry matchEngineRegistry = new MatchEngineFactoryRegistryImpl();
matchEngineRegistry.add(matchEngineFactory);
EMFCompare comparator = EMFCompare.builder()
.setMatchEngineFactoryRegistry(matchEngineRegistry).build();
return comparator;
}
开发者ID:leondart,项目名称:FRaMED,代码行数:22,代码来源:TransformationTestSuite.java
示例3: unidirectionalComparation
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
private static double unidirectionalComparation(String first, String second, boolean semanticFlag) {
IComparisonScope comparisonScope = buildComparisonScope(first, second);
IMatchEngine.Factory.Registry registry = buildMatchEngineFactoryRegistry(semanticFlag);
Comparison comparison = executeComparison(registry, comparisonScope);
if(semanticFlag){
printComparisonResults(comparison);
}
return evaluateComparisonResult(comparison);
}
开发者ID:MDEGroup,项目名称:EMFCompare-Semantic-Extension,代码行数:10,代码来源:Test.java
示例4: initCompare
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
/**
* Initialize the compare engine.
*
* @param packageIgnoreChecker
* The checker to decide if an element is within a package to ignore.
* @param diffingOptions
* The options configuring the comparison.
* @return The prepared emf compare engine.
*/
private EMFCompare initCompare(PackageIgnoreChecker packageIgnoreChecker, Map<String, String> diffingOptions) {
IMatchEngine.Factory.Registry matchEngineRegistry = initMatchEngine(packageIgnoreChecker, diffingOptions);
IPostProcessor.Descriptor.Registry<?> postProcessorRegistry = initPostProcessors(packageIgnoreChecker,
diffingOptions);
IDiffEngine diffEngine = initDiffEngine(packageIgnoreChecker);
EMFCompare comparator = initComparator(matchEngineRegistry, postProcessorRegistry, diffEngine);
return comparator;
}
开发者ID:kopl,项目名称:SPLevo,代码行数:19,代码来源:JaMoPPDiffer.java
示例5: getMatchEngine
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
@Override
public IMatchEngine getMatchEngine() {
final IComparisonFactory comparisonFactory = new DefaultComparisonFactory(new DefaultEqualityHelperFactory());
final IEObjectMatcher matcher = DefaultMatchEngine.createDefaultEObjectMatcher(UseIdentifiers.WHEN_AVAILABLE);
return new SCTMatchEngine(matcher, comparisonFactory);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:7,代码来源:SCTMatchEngineFactory.java
示例6: create
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
public static IMatchEngine create() {
return create(UseIdentifiers.WHEN_AVAILABLE,
WeightProviderDescriptorRegistryImpl.createStandaloneInstance());
}
开发者ID:MDEGroup,项目名称:EMFCompare-Semantic-Extension,代码行数:5,代码来源:SemanticMatchEngine.java
示例7: buildMatchEngineFactoryRegistry
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
private static IMatchEngine.Factory.Registry buildMatchEngineFactoryRegistry(boolean semanticFlag) {
return semanticFlag ? SemanticMatchEngineFactoryRegistryImpl.createStandaloneInstance() : MatchEngineFactoryRegistryImpl.createStandaloneInstance();
}
开发者ID:MDEGroup,项目名称:EMFCompare-Semantic-Extension,代码行数:4,代码来源:Test.java
示例8: executeComparison
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
private static Comparison executeComparison(IMatchEngine.Factory.Registry registry, IComparisonScope scope) {
return EMFCompare.builder().setMatchEngineFactoryRegistry(registry).build().compare(scope);
}
开发者ID:MDEGroup,项目名称:EMFCompare-Semantic-Extension,代码行数:4,代码来源:Test.java
示例9: create
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
public static IMatchEngine create(){
return create(UseIdentifiers.WHEN_AVAILABLE, WeightProviderDescriptorRegistryImpl.createStandaloneInstance());
}
开发者ID:MDEGroup,项目名称:EMFCompare-Semantic-Extension,代码行数:4,代码来源:SemanticMatchEngine.java
示例10: getMatchEngine
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public IMatchEngine getMatchEngine() {
return SemanticMatchEngine.create(UseIdentifiers.NEVER, EMFCompareRCPPlugin.getDefault().getWeightProviderRegistry());
}
开发者ID:MDEGroup,项目名称:EMFCompare-Semantic-Extension,代码行数:7,代码来源:SemanticRCPMatchEngineFactoryImpl.java
示例11: merge
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
public static EObject merge(URI localChanges, URI original, URI remote) throws IncQueryException {
Resource originalModel = new ResourceSetImpl().getResource(original, true);
Resource remoteModel = new ResourceSetImpl().getResource(remote, true);
// Configure EMF Compare
IEObjectMatcher matcher = DefaultMatchEngine.createDefaultEObjectMatcher(UseIdentifiers.WHEN_AVAILABLE);
IComparisonFactory comparisonFactory = new DefaultComparisonFactory(new DefaultEqualityHelperFactory());
IMatchEngine.Factory matchEngineFactory = new MatchEngineFactoryImpl(matcher, comparisonFactory);
matchEngineFactory.setRanking(20);
IMatchEngine.Factory.Registry matchEngineRegistry = new MatchEngineFactoryRegistryImpl();
matchEngineRegistry.add(matchEngineFactory);
EMFCompare comparator = EMFCompare.builder().setMatchEngineFactoryRegistry(matchEngineRegistry).build();
// Compare the two models
IComparisonScope scopeOR = EMFCompare.createDefaultScope(remoteModel, originalModel);
Comparison comparisonOR = comparator.compare(scopeOR);
ChangeSet changeSetOR = EMFCompareTranslator.translate(comparisonOR);
ChangeSet changeSetOL = null;
boolean hasLocalChanges = new File(localChanges.toFileString()).exists();
if(hasLocalChanges) {
changeSetOL = (ChangeSet) new ResourceSetImpl().getResource(localChanges, true).getContents().get(0);
EList<Change> changes = changeSetOL.getChanges();
for (Change change : changes) {
change.setExecutable(true);
}
} else {
changeSetOL = ModelFactory.eINSTANCE.createChangeSet();
}
Collection<DSETransformationRule<?,?>>rules = Lists.<DSETransformationRule<?,?>>newArrayList(
new DSETransformationRule<CreateMatch,CreateMatcher>(CreateQuerySpecification.instance(), new CreateOperation()),
new DSETransformationRule<DeleteMatch,DeleteMatcher>(DeleteQuerySpecification.instance(), new DeleteOperation()),
new DSETransformationRule<SetReferenceMatch,SetReferenceMatcher>(SetReferenceQuerySpecification.instance(), new SetReferenceOperation()),
new DSETransformationRule<AddReferenceMatch,AddReferenceMatcher>(AddReferenceQuerySpecification.instance(), new AddReferenceOperation()),
new DSETransformationRule<RemoveReferenceMatch,RemoveReferenceMatcher>(RemoveReferenceQuerySpecification.instance(), new RemoveReferenceOperation()),
new DSETransformationRule<SetAttributeMatch,SetAttributeMatcher>(SetAttributeQuerySpecification.instance(), new SetAttributeOperation()),
new DSETransformationRule<AddAttributeMatch,AddAttributeMatcher>(AddAttributeQuerySpecification.instance(), new AddAttributeOperation()),
new DSETransformationRule<RemoveAttributeMatch,RemoveAttributeMatcher>(RemoveAttributeQuerySpecification.instance(), new RemoveAttributeOperation()));
Collection<IQuerySpecification<?>>goals = Lists.<IQuerySpecification<?>>newArrayList(
GoalPatternQuerySpecification.instance()
);
DSEMergeManager manager = DSEMergeManager.create(originalModel.getContents().get(0), changeSetOL, changeSetOR);
manager.setMetamodel(WTSpec4MPackage.eINSTANCE);
manager.setId2EObject(Id2objectQuerySpecification.instance());
manager.setRules(rules);
manager.setObjectives(goals);
Collection<Solution> solutions = manager.start();
EObject merged = solutions.iterator().next().getScope().getOrigin();
return merged;
}
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:57,代码来源:Activator.java
示例12: getMatchEngine
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
@Override
public IMatchEngine getMatchEngine() {
return new HierarchicalMatchEngine(equalityHelper, equalityStrategy,
ignoreStrategy, resourceMatcher);
}
开发者ID:kopl,项目名称:SPLevo,代码行数:6,代码来源:HierarchicalMatchEngineFactory.java
示例13: createStandaloneInstance
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
/**
* Returns a registry filled with the default match engine factory provided
* by EMF Compare {@link MatchEngineFactoryImpl} and the semantic match
* engine {@link SemanticMatchEngineFactoryImpl}.
*
* @return A registry filled with the default match engine factory provided
* by EMF Compare and the semantic match engine.
*/
public static IMatchEngine.Factory.Registry createStandaloneInstance() {
final IMatchEngine.Factory.Registry registry = new SemanticMatchEngineFactoryRegistryImpl();
final SemanticMatchEngineFactoryImpl semanticMatchEngineFactory = new SemanticMatchEngineFactoryImpl();
semanticMatchEngineFactory.setRanking(20);
registry.add(semanticMatchEngineFactory);
return registry;
}
开发者ID:MDEGroup,项目名称:EMFCompare-Semantic-Extension,代码行数:16,代码来源:SemanticMatchEngineFactoryRegistryImpl.java
示例14: createStandaloneInstance
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
/**
* Returns a registry filled with the default match engine factory provided
* by EMF Compare {@link MatchEngineFactoryImpl} and the semantic match
* engine {@link CustomMatchEngineFactoryImpl}.
*
* @return A registry filled with the default match engine factory provided
* by EMF Compare and the semantic match engine.
*/
public static IMatchEngine.Factory.Registry createStandaloneInstance() {
final IMatchEngine.Factory.Registry registry = new SemanticMatchEngineFactoryRegistryImpl();
final SemanticMatchEngineFactoryImpl semanticMatchEngineFactory = new SemanticMatchEngineFactoryImpl();
semanticMatchEngineFactory.setRanking(20);
registry.add(semanticMatchEngineFactory);
return registry;
}
开发者ID:MDEGroup,项目名称:EMFCompare-Semantic-Extension,代码行数:16,代码来源:SemanticMatchEngineFactoryRegistryImpl.java
示例15: initComparator
import org.eclipse.emf.compare.match.IMatchEngine; //导入依赖的package包/类
/**
* Init the comparator instance to be used for comparison.
*
* @param matchEngineRegistry
* The registry containing the match engines to be used.
* @param postProcessorRegistry
* Registry for post processors to be executed.
* @param diffEngine
* The diff engine to run.
* @return The prepared comparator instance.
*/
private EMFCompare initComparator(IMatchEngine.Factory.Registry matchEngineRegistry,
IPostProcessor.Descriptor.Registry<?> postProcessorRegistry, IDiffEngine diffEngine) {
EMFCompare.Builder builder = EMFCompare.builder();
builder.setDiffEngine(diffEngine);
builder.setMatchEngineFactoryRegistry(matchEngineRegistry);
builder.setPostProcessorRegistry(postProcessorRegistry);
EMFCompare comparator = builder.build();
return comparator;
}
开发者ID:kopl,项目名称:SPLevo,代码行数:21,代码来源:JaMoPPDiffer.java
注:本文中的org.eclipse.emf.compare.match.IMatchEngine类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论