public final class ReferenceUtil extends Object
Modifier and Type | Method and Description |
---|---|
static List<Object> |
getAsList(EObject object,
EStructuralFeature feature)
This utility simply allows us to retrieve the value of a given feature as a List.
|
static List<Object> |
getAsListResolving(EObject object,
EStructuralFeature feature)
This utility simply allows us to retrieve the value of a given feature as a List.
|
static boolean |
isFeatureMapDerivedFeature(EReference reference)
Checks if the given reference is a FeatureMap-derived feature.
|
static Object |
safeEGet(EObject object,
EStructuralFeature feature)
In case of dynamic EObjects, the EClasses of both sides might be different, making "eget" fail in
"unknown feature".
|
static boolean |
safeEIsSet(EObject object,
EStructuralFeature feature)
In case of dynamic EObjects, the EClasses of both sides might be different, making "isset" fail in
"unknown feature".
|
static void |
safeESet(EObject object,
EStructuralFeature feature,
Object newValue)
In case of dynamic EObjects, the EClasses of both sides might be different, making "isset" fail in
"unknown feature".
|
static Object |
safeResolvingEGet(EObject object,
EStructuralFeature feature)
In case of dynamic EObjects, the EClasses of both sides might be different, making "eget" fail in
"unknown feature".
|
public static List<Object> getAsList(EObject object, EStructuralFeature feature)
object
- The object for which feature we need a value.feature
- The actual feature of which we need the value.feature
for the given object
as a list. An
empty list if this object has no value for that feature or if the object is null
.public static List<Object> getAsListResolving(EObject object, EStructuralFeature feature)
Note that contrary to getAsList(EObject, EStructuralFeature)
, this will allow proxy
resolution.
object
- The object for which feature we need a value.feature
- The actual feature of which we need the value.feature
for the given object
as a list. An
empty list if this object has no value for that feature or if the object is null
.public static Object safeEGet(EObject object, EStructuralFeature feature)
object
- The object for which feature we need a value, must not be null
.feature
- The actual feature of which we need the value, must not be null
.feature
for the given object
.public static Object safeResolvingEGet(EObject object, EStructuralFeature feature)
Note that contrary to safeEGet(EObject, EStructuralFeature)
, this will allow proxy
resolution.
object
- The object for which feature we need a value, must not be null
.feature
- The actual feature of which we need the value, must not be null
.feature
for the given object
.public static boolean safeEIsSet(EObject object, EStructuralFeature feature)
object
- The object for which feature we need a value, must not be null
.feature
- The actual feature of which we need the value, must not be null
.feature
for the given object
is set.public static void safeESet(EObject object, EStructuralFeature feature, Object newValue)
object
- The object for which feature we'll set the value, must not be null
.feature
- The actual feature of which we'll set the value, must not be null
.newValue
- The value to set, can be null
.public static boolean isFeatureMapDerivedFeature(EReference reference)
reference
- the given EReference.
Copyright (c) 2006, 2015 Obeo and others. All rights reserved.