org.eclipse.emf.facet.efacet.core

## Class FacetUtils

- java.lang.Object
- - org.eclipse.emf.facet.efacet.core.FacetUtils

    public final class FacetUtils
    extends java.lang.Object

Since:
  0.2

### Method Summary

All Methods Static Methods Concrete Methods
`static EClass` `findExtendedEClass(Facet facet)`
`static java.util.Set<EPackage>` `getAllExtendedEPackage(FacetSet facetSet)`
`static java.util.List<Facet>` `getAllFacet(FacetSet facetSet)`
`static java.util.Map<java.lang.String,Facet>` `getAllFacetsByName(FacetSet parent)` Return all the facets of the model.
`static java.util.Map<java.lang.String,FacetSet>` `getAllFacetSetsByName(EPackage parent)` Return all the facets of the model.
`static java.util.Map<java.lang.String,FacetOperation>` `getAllOperationsByName(FacetSet parent)` Return all the operations of the model.
`static java.util.Set<EStructuralFeature>` `getAllStructrualFeatures(EObject eObject, IFacetManager facetMgr)`
`static DerivedTypedElement` `getContainingDerivedTypedElement(EObject eObject)`
`static FacetSet` `getContainingFacetSet(EObject eObject)` Return the main facetSet.
`static <T extends ETypedElement> T` `getETypedElement(Facet facet, java.lang.String name, java.lang.Class<T> classs)`
`static java.util.List<ETypedElement>` `getETypedElements(EClassifier eClassifier)`
`static <T extends ETypedElement> java.util.Set<T>` `getETypedElements(EObject eObject, java.lang.Class<T> classs, IFacetManager facetManager)`
`static java.util.List<ETypedElement>` `getETypedElements(EPackage ePackage)`
`static java.util.Set<? extends ETypedElement>` `getETypedElements(ResourceSet resourceSet)` This methods returns all the known (registered) eTypedElements.
`static EPackage` `getExtendedEPackage(FacetSet facetSet)`
`static EClass` `getExtendedMetaclass(Facet facet)`
`static Facet` `getFacet(java.util.Collection<Facet> facets, java.lang.String name)` Find a Facet with the given name among the given list of Facets.
`static Facet` `getFacet(FacetSet facetSet, java.lang.String facetName)` Find a Facet in a FacetSet
`static java.util.Set<? extends ETypedElement>` `getFacetETypedElements(ResourceSet resourceSet)`
`static java.util.List<Facet>` `getFacets(FacetSet facetSet)`
`static FacetSet` `getFacetSet(java.util.Collection<FacetSet> facetSets, java.lang.String name)` Find a FacetSet with the given name among the given list of FacetSets.
`static FacetSet` `getFacetSet(ETypedElement eTypedElement)`
`static FacetSet` `getFacetSet(Facet facet)`
`static java.util.List<FacetSet>` `getFacetSets(java.util.Collection<FacetSet> facetSets, java.lang.String name)` Find all FacetSets with the given name among the given list of FacetSets.
`static java.util.List<FacetSet>` `getFacetSetsByPath(java.util.Collection<FacetSet> rootFacetSets, java.lang.String... path)` Find all the FacetSets with the given path among the given list of root FacetSets.
`static java.lang.Object` `getResultValue(ETypedElementResult eTEresult)`
`static FacetSet` `getRootFacetSet(Facet facet)`
`static FacetSet` `getRootFacetSet(FacetSet facetSet)`
`static DerivedTypedElement` `getSignature(FacetOperation facetOperation)`
`static <T extends DerivedTypedElement> T` `getTopOverrideFeature(T feature)` Find the top level feature in the override chain
`static java.lang.String` `toString(DerivedTypedElement feature)`

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

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

### Method Detail

#### getFacet

    public static Facet getFacet(FacetSet facetSet,
                                 java.lang.String facetName)

Find a Facet in a FacetSet

Parameters:
  `facetSet` - the FacetSet
  `facetName` - the name of the Facet to look for
Returns:
  the Facet with the given name in the given FacetSet

#### getETypedElement

    public static <T extends ETypedElement> T getETypedElement(Facet facet,
                                                               java.lang.String name,
                                                               java.lang.Class<T> classs)

#### getResultValue

    public static java.lang.Object getResultValue(ETypedElementResult eTEresult)

#### getFacetSet

    public static FacetSet getFacetSet(java.util.Collection<FacetSet> facetSets,
                                       java.lang.String name)

Find a FacetSet with the given name among the given list of FacetSets. If several FacetSets have the same name, then return the first one.

Parameters:
  `facetSets` - where to look for
  `name` - the name of the FacetSet to find
Returns:
  the FacetSet, or `null` if not found in the given list

#### getFacetSets

    public static java.util.List<FacetSet> getFacetSets(java.util.Collection<FacetSet> facetSets,
                                                        java.lang.String name)

Find all FacetSets with the given name among the given list of FacetSets.

Parameters:
  `facetSets` - where to look for
  `name` - the name of the FacetSets to find
Returns:
  the FacetSets with the given name

#### getAllExtendedEPackage

    public static java.util.Set<EPackage> getAllExtendedEPackage(FacetSet facetSet)

Parameters:
  `facetSet` - a facetSet
Returns:
  a set with all the EPackage extended by the facetSet and its owned facetSet
Since:
  0.2

#### getFacetSetsByPath

    public static java.util.List<FacetSet> getFacetSetsByPath(java.util.Collection<FacetSet> rootFacetSets,
                                                              java.lang.String... path)

Find all the FacetSets with the given path among the given list of root FacetSets. For example: `getFacetSetsByPath("a", "b", "c")` returns a FacetSet named "c", contained in a FacetSet named "b", contained in a registered FacetSet named "a".

Parameters:
  `path` - a list of FacetSet names, starting from the root registered FacetSets, and leading to the wanted FacetSet(s)
Returns:
  the FacetSets that have the given path

#### getFacet

    public static Facet getFacet(java.util.Collection<Facet> facets,
                                 java.lang.String name)

Find a Facet with the given name among the given list of Facets.

Parameters:
  `facets` - where to look
  `name` - the name of the Facet that is being looked for
Returns:
  the first `Facet` with this name, or `null` if none

#### getRootFacetSet

    public static FacetSet getRootFacetSet(Facet facet)

#### getRootFacetSet

    public static FacetSet getRootFacetSet(FacetSet facetSet)

#### getETypedElements

    public static java.util.Set<? extends ETypedElement> getETypedElements(ResourceSet resourceSet)

This methods returns all the known (registered) eTypedElements.

Parameters:
  `resourceSet` - the eTypedElement search will be done in/using this resourceSet
Returns:
  all the known (registered) eTypedElements

#### getFacetETypedElements

    public static java.util.Set<? extends ETypedElement> getFacetETypedElements(ResourceSet resourceSet)

Since:
  0.3

#### getETypedElements

    public static java.util.List<ETypedElement> getETypedElements(EPackage ePackage)

#### getETypedElements

    public static java.util.List<ETypedElement> getETypedElements(EClassifier eClassifier)

Since:
  0.3

#### getFacets

    public static java.util.List<Facet> getFacets(FacetSet facetSet)

#### getFacetSet

    public static FacetSet getFacetSet(Facet facet)

#### getExtendedEPackage

    public static EPackage getExtendedEPackage(FacetSet facetSet)

#### getETypedElements

    public static <T extends ETypedElement> java.util.Set<T> getETypedElements(EObject eObject,
                                                                               java.lang.Class<T> classs,
                                                                               IFacetManager facetManager)
                                                                        throws FacetManagerException

Throws:
  `FacetManagerException`

#### getFacetSet

    public static FacetSet getFacetSet(ETypedElement eTypedElement)

Parameters:
  `eTypedElement` -
Returns:
Since:
  0.2

#### getSignature

    public static DerivedTypedElement getSignature(FacetOperation facetOperation)

Parameters:
  `facetOperation` -
Returns:
Since:
  0.2

#### getExtendedMetaclass

    public static EClass getExtendedMetaclass(Facet facet)

Parameters:
  `facet` -
Returns:
Since:
  0.2

#### getTopOverrideFeature

    public static <T extends DerivedTypedElement> T getTopOverrideFeature(T feature)
                                                                   throws FacetManagerException

Find the top level feature in the override chain

Parameters:
  `feature` -
Returns:
  The top level feature in the override chain or the feature parameter itself if no override
Throws:
  `FacetManagerException`
Since:
  0.2

#### findExtendedEClass

    public static EClass findExtendedEClass(Facet facet)

Since:
  0.3

#### getContainingDerivedTypedElement

    public static DerivedTypedElement getContainingDerivedTypedElement(EObject eObject)

Since:
  0.3

#### getContainingFacetSet

    public static FacetSet getContainingFacetSet(EObject eObject)

Return the main facetSet.

Parameters:
  `eObject` - the element in the model selected.
Returns:
  the main facetSet.
Since:
  0.3

#### getAllOperationsByName

    public static java.util.Map<java.lang.String,FacetOperation> getAllOperationsByName(FacetSet parent)

Return all the operations of the model.

Parameters:
  `parent` - the first FacetSet of the model.
Returns:
  the list of operations.
Since:
  0.3

#### getAllFacetsByName

    public static java.util.Map<java.lang.String,Facet> getAllFacetsByName(FacetSet parent)

Return all the facets of the model.

Parameters:
  `parent` - the first FacetSet of the model.
Returns:
  the list of facets.
Since:
  0.3

#### getAllFacetSetsByName

    public static java.util.Map<java.lang.String,FacetSet> getAllFacetSetsByName(EPackage parent)

Return all the facets of the model.

Parameters:
  `parent` - the first FacetSet of the model.
Returns:
  the list of facets.
Since:
  0.3

#### getAllFacet

    public static java.util.List<Facet> getAllFacet(FacetSet facetSet)

Since:
  0.3

#### getAllStructrualFeatures

    public static java.util.Set<EStructuralFeature> getAllStructrualFeatures(EObject eObject,
                                                                             IFacetManager facetMgr)
                                                                      throws FacetManagerException

Throws:
  `FacetManagerException`
Since:
  1.2

#### toString

    public static java.lang.String toString(DerivedTypedElement feature)

Since:
  1.0