org.eclipse.emf.facet.util.emf.core

## Class ModelUtils

- java.lang.Object
- - org.eclipse.emf.facet.util.emf.core.ModelUtils

    public final class ModelUtils
    extends java.lang.Object

Utility class for models.

Since:
  0.2

### Method Summary

All Methods Static Methods Concrete Methods
`static java.util.List<EClass>` `allSubClasses(EClass context)` Find all subclasses of the given metaclass in the package registry
`static java.util.List<EObject>` `computeAssignableElements(EStructuralFeature feature, EObject source)` Computes a list of `EObject`s from the same `ResourceSet` as `source` that can be assigned to the given feature.
`static java.lang.String` `getDefaultName(EObject eObject)`
`static java.lang.String` `getMetaclassQualifiedName(EClassifier eClass)`
`static java.lang.String` `getName(EObject eObject)` Returns a name for the given model element from the EMF global registry, or use a default name taken from a String attribute.
`static ResourceSet` `getOrCreateResourceSet(EObject eObject)`
`static IProject` `getProject(EObject eObject)`
`static java.lang.String` `getQualifiedName(ENamedElement namedElement)`
`static boolean` `isBooleanDataType(EClassifier classifier)`
`static boolean` `isSuperTypeOf(EClass self, EClass typeDeclaration)`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### computeAssignableElements

    public static java.util.List<EObject> computeAssignableElements(EStructuralFeature feature,
                                                                    EObject source)

Computes a list of `EObject`s from the same `ResourceSet` as `source` that can be assigned to the given feature.

#### isBooleanDataType

    public static boolean isBooleanDataType(EClassifier classifier)

#### allSubClasses

    public static java.util.List<EClass> allSubClasses(EClass context)

Find all subclasses of the given metaclass in the package registry

Parameters:
  `context` - the metaclass whose subclasses must be found
Returns:
  all the subclasses

#### isSuperTypeOf

    public static boolean isSuperTypeOf(EClass self,
                                        EClass typeDeclaration)

#### getMetaclassQualifiedName

    public static java.lang.String getMetaclassQualifiedName(EClassifier eClass)

Returns:
  the qualified name of the given metaclass

#### getName

    public static java.lang.String getName(EObject eObject)

Returns a name for the given model element from the EMF global registry, or use a default name taken from a String attribute.

Returns:
  a name for the given element

#### getDefaultName

    public static java.lang.String getDefaultName(EObject eObject)

Returns:
  a default name based on a string feature of the given `EObject`

#### getQualifiedName

    public static java.lang.String getQualifiedName(ENamedElement namedElement)

Parameters:
  `namedElement` -
Returns:

#### getOrCreateResourceSet

    public static ResourceSet getOrCreateResourceSet(EObject eObject)

Since:
  0.3

#### getProject

    public static IProject getProject(EObject eObject)

Since:
  0.3