org.eclipse.emf.facet.efacet.core
Class FacetUtils

java.lang.Object
  extended by org.eclipse.emf.facet.efacet.core.FacetUtils

public final class FacetUtils
extends java.lang.Object

Since:
0.2

Method Summary
static java.util.Set<EPackage> getAllExtendedEPackage(FacetSet facetSet)
           
static
<T extends ETypedElement>
T
getETypedElement(Facet facet, java.lang.String name, java.lang.Class<T> classs)
           
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.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
 
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

getETypedElements

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

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