org.eclipse.gmt.umlx.alien.mapping
Class MappingUtils

java.lang.Object
  extended by org.eclipse.gmt.umlx.alien.mapping.MappingUtils

public abstract class MappingUtils
extends java.lang.Object


Constructor Summary
MappingUtils()
           
 
Method Summary
static
<T> T
asClassUnchecked(java.lang.Object object, T requiredClassObject)
           
static java.util.Map<java.lang.String,org.eclipse.emf.ecore.EPackage> createPackageMap(org.eclipse.emf.ecore.resource.Resource resource)
          Return a Map from EPackage.nsURI to EPackage for all packages within resource.
static void createPackageMapRecursion(java.util.Map<java.lang.String,org.eclipse.emf.ecore.EPackage> uriToPackageMap, java.util.List<? extends org.eclipse.emf.ecore.EObject> eObjects)
           
static java.util.List<org.eclipse.emf.ecore.EGenericType> excludeNonGenericTypes(java.util.List<org.eclipse.emf.ecore.EGenericType> genericTypes)
          Return a list of generic types, all of which are generic.
static java.lang.String formatFeatureName(AbstractFeatureElement<?> feature)
           
static java.lang.String formatFeatureName(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
           
static java.lang.String formatFullName(java.lang.Object object)
           
static java.lang.String formatLocalName(java.lang.Object object)
           
static java.lang.String formatString(java.lang.Object object)
           
static boolean isGeneric(org.eclipse.emf.ecore.EGenericType eGenericType)
          Return true if eGenericType is a generic type.
static boolean isGeneric(org.eclipse.emf.ecore.ETypedElement eTypedElement)
          Return true if eTypedElement uses a generic type.
static void promoteReferencesToSelfToSelf(org.eclipse.emf.ecore.resource.Resource resource)
          Redirect the target of all references from within resource that could be resolved within resource to be resolved within resource.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappingUtils

public MappingUtils()
Method Detail

asClassUnchecked

public static <T> T asClassUnchecked(java.lang.Object object,
                                     T requiredClassObject)

createPackageMap

public static java.util.Map<java.lang.String,org.eclipse.emf.ecore.EPackage> createPackageMap(org.eclipse.emf.ecore.resource.Resource resource)
Return a Map from EPackage.nsURI to EPackage for all packages within resource.


createPackageMapRecursion

public static void createPackageMapRecursion(java.util.Map<java.lang.String,org.eclipse.emf.ecore.EPackage> uriToPackageMap,
                                             java.util.List<? extends org.eclipse.emf.ecore.EObject> eObjects)

excludeNonGenericTypes

public static java.util.List<org.eclipse.emf.ecore.EGenericType> excludeNonGenericTypes(java.util.List<org.eclipse.emf.ecore.EGenericType> genericTypes)
Return a list of generic types, all of which are generic. If all input genericTypes are generic the original list is returned.


formatFeatureName

public static java.lang.String formatFeatureName(AbstractFeatureElement<?> feature)

formatFeatureName

public static java.lang.String formatFeatureName(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)

formatFullName

public static java.lang.String formatFullName(java.lang.Object object)

formatLocalName

public static java.lang.String formatLocalName(java.lang.Object object)

formatString

public static java.lang.String formatString(java.lang.Object object)

isGeneric

public static boolean isGeneric(org.eclipse.emf.ecore.ETypedElement eTypedElement)
Return true if eTypedElement uses a generic type.


isGeneric

public static boolean isGeneric(org.eclipse.emf.ecore.EGenericType eGenericType)
Return true if eGenericType is a generic type.


promoteReferencesToSelfToSelf

public static void promoteReferencesToSelfToSelf(org.eclipse.emf.ecore.resource.Resource resource)
Redirect the target of all references from within resource that could be resolved within resource to be resolved within resource. This is typically required to remove references to an independent meta-model for which resource is intended to be a self standing replacement. For instance if resource is a new copy of Ecore, internal references to the old copy of Ecore that assisted in its creation need replacing by references the the new Ecore.