public class RepositoryHelper
extends java.lang.Object
EcoreUtil extensions| Constructor and Description |
|---|
RepositoryHelper() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends EObject> |
copyInto(T source,
T target)
Returns a self-contained copy of the source that will be copied into
target.
|
static <T extends EObject> |
copyInto(T source,
T target,
java.util.List<EStructuralFeature> featuresToOmit)
Returns a self-contained copy of the source that will be copied into
target.
|
static <T extends EObject> |
copySelectiv(T eObject,
java.util.List<java.lang.String> includedFeaturePaths)
Copies the given
EObject and includes all the features named in the includedFeaturePaths List |
static java.lang.String |
getUriHintNameForEClass(EClass eClass)
Retrieves the name of the
EClass that should be used as eclass segment in the URI. |
static java.lang.String |
setIds(EObject eObject)
Sets ids for the specified
EObject and all its contained EObjects. |
public static <T extends EObject> T copyInto(T source,
T target)
T - the type of the EObjectsource - the object to copy.target - the object to copy the source into.Copierpublic static <T extends EObject> T copyInto(T source,
T target,
java.util.List<EStructuralFeature> featuresToOmit)
EStructuralFeature will not be overwritten
in the target.T - the type of the EObjectsource - the object to copy.target - the object to copy the source into.featuresToOmit - the features that will not be overwritten in the targetCopierpublic static <T extends EObject> T copySelectiv(T eObject,
java.util.List<java.lang.String> includedFeaturePaths)
EObject and includes all the features named in the includedFeaturePaths ListT - the object typeeObject - the EObject to copyincludedFeaturePaths - the List of feature paths to include.public static java.lang.String setIds(EObject eObject)
EObject and all its contained EObjects.eObject - the EObjectEObject or null if the EObject has no id featurepublic static java.lang.String getUriHintNameForEClass(EClass eClass)
EClass that should be used as eclass segment in the URI.
By default this is the EClass#getName(). If anywhere in the EClass or on off its super classes the annotation UriHint is found, a different name will be chosen.
At first a possibly named reference will be used. This can reference to any EClass, even if it is not a super type of the given EClass. If found it will call getUriHintNameForEClass(EClass) with the found reference.
So the name returned String will be at least name of the referenced EClass.
If such a reference is not present a DetailEntry with the key name will be taken under consideration.
The first annotation found on the class hierarchy will define the hint.eClass - Data In Motion Consulting