public final class MatchUtil extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
featureContains(EObject eObject,
EStructuralFeature feature,
Object value)
Determines whether the given feature of the given
EObject contains the provided value, while
correctly handling proxies (in other words, in case of proxies, the proxy URI is compared instead of
the objects, which would otherwise lead to false negatives). |
static Iterable<Diff> |
findAddOrDeleteContainmentDiffs(Match match)
Get the potential ReferenceChanges that represent add/delete containment differences in the parent
Match of the given Match.
|
static EObject |
getContainer(Comparison comparison,
Diff difference)
Get the business model object containing the given
difference . |
static EObject |
getMatchedObject(Match m,
DifferenceSource side)
Get the object matched by a Match on a given side.
|
static EObject |
getOriginContainer(Comparison comparison,
Diff difference)
Get the business model object containing the given
difference in the origin side. |
static EObject |
getOriginObject(Comparison comparison,
EObject object)
Get the object which is the origin value from the given matching
object . |
static EObject |
getOriginValue(Comparison comparison,
ReferenceChange difference)
From a given mono-valued reference change, get the origin value.
|
static EStructuralFeature |
getStructuralFeature(Diff input)
Get the structural feature of any difference.
|
static Object |
getValue(Diff input)
Get the value of any difference.
|
public static EObject getOriginObject(Comparison comparison, EObject object)
object
.comparison
- The comparison.object
- The given object.public static EObject getOriginValue(Comparison comparison, ReferenceChange difference)
comparison
- The comparison.difference
- The given reference change.public static EObject getOriginContainer(Comparison comparison, Diff difference)
difference
in the origin side.comparison
- The comparison.difference
- The difference.public static EObject getContainer(Comparison comparison, Diff difference)
difference
.comparison
- The comparison.difference
- The difference.public static boolean featureContains(EObject eObject, EStructuralFeature feature, Object value)
EObject
contains the provided value, while
correctly handling proxies (in other words, in case of proxies, the proxy URI is compared instead of
the objects, which would otherwise lead to false negatives).eObject
- The object of which a feature is to be checkedfeature
- The feature of which containment is to be checkedvalue
- The value which is to be verified in the featuretrue
if the feature contains the given valuepublic static Object getValue(Diff input)
input
- The difference.public static EStructuralFeature getStructuralFeature(Diff input)
input
- The difference.public static EObject getMatchedObject(Match m, DifferenceSource side)
m
- The match, must not be null
side
- The side for which we want the matched value, use null
for ORIGIN.public static Iterable<Diff> findAddOrDeleteContainmentDiffs(Match match)
match
- the given Match.null
otherwise.
Copyright (c) 2006, 2015 Obeo and others. All rights reserved.