public class RootIDMatchingStrategy extends Object implements IResourceMatchingStrategy
Constructor and Description |
---|
RootIDMatchingStrategy() |
Modifier and Type | Method and Description |
---|---|
protected MatchResource |
createMatchResource(Resource left,
Resource right,
Resource origin)
Creates a
MatchResource instance and sets all three resources of the mapping on it. |
protected Resource |
findMatch(Resource reference,
Iterable<Resource> candidates)
Returns the first match of
reference in candidates . |
protected Set<String> |
getResourceIdentifiers(Resource resource)
Retrieves the set of identifiers for the given resource's root.
|
List<MatchResource> |
matchResources(Iterable<? extends Resource> left,
Iterable<? extends Resource> right,
Iterable<? extends Resource> origin)
This will be called by the resource matcher in order to determine the matching between n
resources.
|
public List<MatchResource> matchResources(Iterable<? extends Resource> left, Iterable<? extends Resource> right, Iterable<? extends Resource> origin)
matchResources
in interface IResourceMatchingStrategy
left
- Resources we are to match in the left.right
- Resources we are to match in the right.origin
- Resources we are to match in the origin.IResourceMatchingStrategy.matchResources(java.lang.Iterable,
java.lang.Iterable, java.lang.Iterable)
protected Resource findMatch(Resource reference, Iterable<Resource> candidates)
reference
in candidates
. This implementation will
consider two Resources to be "matches" if their roots have IDs, and these IDs are the same.reference
- The reference resource.candidates
- The list of potential candidates that may match reference
.reference
in candidates
. null
if
none.protected Set<String> getResourceIdentifiers(Resource resource)
resource
- The resource for which we need the identifiers.protected MatchResource createMatchResource(Resource left, Resource right, Resource origin)
MatchResource
instance and sets all three resources of the mapping on it.left
- The left resource of this mapping.right
- The right resource of this mapping.origin
- The origin resource of this mapping.
Copyright (c) 2006, 2014 Obeo and others. All rights reserved.