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

java.lang.Object
  extended by org.eclipse.emf.ecore.util.BasicExtendedMetaData
      extended by org.eclipse.gmt.umlx.alien.mapping.MappingMetaData
All Implemented Interfaces:
org.eclipse.emf.ecore.util.ExtendedMetaData

public abstract class MappingMetaData
extends org.eclipse.emf.ecore.util.BasicExtendedMetaData

MappingMetaData defines the mapping rules between an Ecore-based model and some similar alien model such as an EMOF-based model. Derived classes should implement the initialise method to provide the mapping rules, and implement the create method to create instances of the adapters between the alien and ecore models. See EMOFMappingMetaData for a complex mapping, EssentialOCLMetaData for a much simpler almost regular mapping and EqvtTemplateMappingMetaData for a trivial mapping.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.util.BasicExtendedMetaData
org.eclipse.emf.ecore.util.BasicExtendedMetaData.EClassExtendedMetaDataImpl, org.eclipse.emf.ecore.util.BasicExtendedMetaData.EClassifierExtendedMetaData, org.eclipse.emf.ecore.util.BasicExtendedMetaData.EDataTypeExtendedMetaDataImpl, org.eclipse.emf.ecore.util.BasicExtendedMetaData.EPackageExtendedMetaData, org.eclipse.emf.ecore.util.BasicExtendedMetaData.EPackageExtendedMetaDataImpl, org.eclipse.emf.ecore.util.BasicExtendedMetaData.EStructuralFeatureExtendedMetaData, org.eclipse.emf.ecore.util.BasicExtendedMetaData.EStructuralFeatureExtendedMetaDataImpl
 
Field Summary
 
Fields inherited from interface org.eclipse.emf.ecore.util.ExtendedMetaData
ANNOTATION_URI, ATTRIBUTE_FEATURE, ATTRIBUTE_WILDCARD_FEATURE, COLLAPSE_WHITE_SPACE, CONTENT_KINDS, DERIVATION_KINDS, ELEMENT_FEATURE, ELEMENT_ONLY_CONTENT, ELEMENT_WILDCARD_FEATURE, EMPTY_CONTENT, FEATURE_KINDS, GROUP_FEATURE, INSTANCE, LAX_PROCESSING, LIST_DERIVATION, MIXED_CONTENT, PRESERVE_WHITE_SPACE, PROCESSING_KINDS, REPLACE_WHITE_SPACE, RESTRICTION_DERIVATION, SIMPLE_CONTENT, SIMPLE_FEATURE, SKIP_PROCESSING, STRICT_PROCESSING, UNION_DERIVATION, UNSPECIFIED_CONTENT, UNSPECIFIED_DERIVATION, UNSPECIFIED_FEATURE, UNSPECIFIED_PROCESSING, UNSPECIFIED_WHITE_SPACE, WHITE_SPACE_KINDS, XMI_URI, XML_SCHEMA_URI, XML_URI, XMLNS_PREFIX, XMLNS_URI, XSI_PREFIX, XSI_URI
 
Method Summary
 org.eclipse.emf.ecore.EObject create(org.eclipse.emf.ecore.EClass alienClass)
           
 org.eclipse.emf.ecore.EAttribute createDemandFeature(org.eclipse.emf.ecore.EAttribute ecoreFeature, java.lang.Object defaultValue)
           
 org.eclipse.emf.ecore.EReference createDemandFeature(org.eclipse.emf.ecore.EReference ecoreFeature, java.lang.Object defaultValue)
           
 org.eclipse.emf.ecore.EPackage demandPackage(java.lang.String namespace)
           
 org.eclipse.emf.ecore.EDataType exportEDataType(org.eclipse.emf.ecore.EDataType ecoreEDataType)
          Convert an EDataType used in an alien model to that used in an Ecore model.
 org.eclipse.emf.ecore.EObject getAdapter(org.eclipse.emf.ecore.EObject ecoreObject)
           
 AlienXMIResourceAdapter getAdapter(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.common.util.URI uri)
          Create an adapter for the resource defining the adapter URI, if created, as uri.
<E extends org.eclipse.emf.ecore.EObject,A extends org.eclipse.emf.ecore.EObject>
org.eclipse.emf.common.util.EList<A>
getAdapters(org.eclipse.emf.common.util.EList<E> ecoreObjects)
           
 org.eclipse.emf.ecore.EFactory getAdaptingFactory(org.eclipse.emf.ecore.EFactory adaptedFactory)
           
 EClassMap getAlienEClassMap(org.eclipse.emf.ecore.EClass alienEClass)
           
 EStructuralFeatureMap<? extends org.eclipse.emf.ecore.EStructuralFeature> getAlienEStructuralFeatureMap(org.eclipse.emf.ecore.EStructuralFeature alienFeature)
           
 org.eclipse.emf.ecore.EObject getAlienPackage(org.eclipse.emf.ecore.EPackage ecorePackage)
           
 java.util.Map<java.lang.String,org.eclipse.emf.ecore.resource.Resource.Factory> getContentToFactoryMap()
           
 EClassMap getEcoreEClassMap(org.eclipse.emf.ecore.EClass ecoreEClass)
           
 EStructuralFeatureMap<? extends org.eclipse.emf.ecore.EStructuralFeature> getEcoreEStructuralFeatureMap(org.eclipse.emf.ecore.EStructuralFeature ecoreFeature)
           
 org.eclipse.emf.ecore.EPackage getEcorePackage(org.eclipse.emf.ecore.EObject alienPackage)
           
 java.util.Collection<org.eclipse.emf.ecore.EPackage> getEcorePackages()
           
 EStructuralFeatureMap<? extends org.eclipse.emf.ecore.EStructuralFeature> getFeatureMap(org.eclipse.emf.ecore.EClass ecoreEClass, org.eclipse.emf.ecore.EStructuralFeature ecoreFeature)
           
abstract  java.lang.String getName()
          Return a brief description of this meta data such "EMOF".
 org.eclipse.emf.ecore.EPackage getPackage(java.lang.String namespace)
           
 java.util.List<org.eclipse.emf.ecore.xml.type.AnyType> getXMIExtensions(org.eclipse.emf.ecore.EObject object)
          Return a non-null list of AnyType objects that serve as Ecore extensions of object.
 java.util.List<org.eclipse.emf.ecore.xml.type.AnyType> getXMIExtensionsOrNull(org.eclipse.emf.ecore.EObject object)
          Return a possibly null list of AnyType objects that serve as Ecore extensions of object.
 java.util.List<java.lang.Object> getXMIExtensionValuesOrNull(org.eclipse.emf.ecore.EObject object, java.lang.String featureName)
           
 org.eclipse.emf.ecore.EDataType importEDataType(org.eclipse.emf.ecore.EDataType alienEDataType)
          Convert an EDataType used in an alien model to that used in an Ecore model.
 void initialise()
           
 void putAdaptingFactory(org.eclipse.emf.ecore.EFactory adaptingFactory, org.eclipse.emf.ecore.EFactory adaptedFactory)
           
 void putAdaptingPackage(org.eclipse.emf.ecore.EPackage adaptedEPackage)
           
 org.eclipse.emf.ecore.EObject validate(java.io.PrintWriter writer)
          Return null if all ecorePackages have an accurate set of class and feature map declarations.
 
Methods inherited from class org.eclipse.emf.ecore.util.BasicExtendedMetaData
basicGetBaseType, basicGetNamespace, demandedPackages, demandFeature, demandFeature, demandType, getAffiliation, getAffiliation, getAllAttributes, getAllElements, getAttribute, getAttribute, getAttributes, getAttributeWildcardAffiliation, getBaseType, getContentKind, getDerivationKind, getDocumentRoot, getElement, getElement, getElements, getElementWildcardAffiliation, getEncodedWildcards, getEnumerationFacet, getFeatureKind, getFractionDigitsFacet, getGroup, getItemType, getLengthFacet, getLocalAttribute, getMaxExclusiveFacet, getMaxInclusiveFacet, getMaxLengthFacet, getMemberTypes, getMinExclusiveFacet, getMinInclusiveFacet, getMinLengthFacet, getMixedFeature, getName, getName, getNamespace, getNamespace, getNamespace, getPatternFacet, getProcessingKind, getSimpleFeature, getTotalDigitsFacet, getType, getType, getWhiteSpaceFacet, getWildcards, getXMLNSPrefixMapFeature, getXSISchemaLocationMapFeature, isAnonymous, isQualified, matches, matches, putPackage, setAffiliation, setBaseType, setContentKind, setDocumentRoot, setEnumerationFacet, setFeatureKind, setFractionDigitsFacet, setGroup, setItemType, setLengthFacet, setMaxExclusiveFacet, setMaxInclusiveFacet, setMaxLengthFacet, setMemberTypes, setMinExclusiveFacet, setMinInclusiveFacet, setMinLengthFacet, setName, setName, setNamespace, setPatternFacet, setProcessingKind, setQualified, setTotalDigitsFacet, setWhiteSpaceFacet, setWildcards
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public org.eclipse.emf.ecore.EObject create(org.eclipse.emf.ecore.EClass alienClass)

createDemandFeature

public org.eclipse.emf.ecore.EAttribute createDemandFeature(org.eclipse.emf.ecore.EAttribute ecoreFeature,
                                                            java.lang.Object defaultValue)

createDemandFeature

public org.eclipse.emf.ecore.EReference createDemandFeature(org.eclipse.emf.ecore.EReference ecoreFeature,
                                                            java.lang.Object defaultValue)

demandPackage

public org.eclipse.emf.ecore.EPackage demandPackage(java.lang.String namespace)
Specified by:
demandPackage in interface org.eclipse.emf.ecore.util.ExtendedMetaData
Overrides:
demandPackage in class org.eclipse.emf.ecore.util.BasicExtendedMetaData

exportEDataType

public org.eclipse.emf.ecore.EDataType exportEDataType(org.eclipse.emf.ecore.EDataType ecoreEDataType)
Convert an EDataType used in an alien model to that used in an Ecore model.

Parameters:
ecoreValue -
Returns:

getAdaptingFactory

public org.eclipse.emf.ecore.EFactory getAdaptingFactory(org.eclipse.emf.ecore.EFactory adaptedFactory)

getAdapter

public AlienXMIResourceAdapter getAdapter(org.eclipse.emf.ecore.resource.Resource resource,
                                          org.eclipse.emf.common.util.URI uri)
                                   throws MappingConfigurationException
Create an adapter for the resource defining the adapter URI, if created, as uri. If uri is null, the adapter gets a null URI, and is not not registereed with the resource set.

Parameters:
resource -
uri -
Returns:
Throws:
MappingConfigurationException

getAdapter

public org.eclipse.emf.ecore.EObject getAdapter(org.eclipse.emf.ecore.EObject ecoreObject)

getAdapters

public <E extends org.eclipse.emf.ecore.EObject,A extends org.eclipse.emf.ecore.EObject> org.eclipse.emf.common.util.EList<A> getAdapters(org.eclipse.emf.common.util.EList<E> ecoreObjects)

getAlienEClassMap

public EClassMap getAlienEClassMap(org.eclipse.emf.ecore.EClass alienEClass)

getAlienEStructuralFeatureMap

public EStructuralFeatureMap<? extends org.eclipse.emf.ecore.EStructuralFeature> getAlienEStructuralFeatureMap(org.eclipse.emf.ecore.EStructuralFeature alienFeature)

getAlienPackage

public org.eclipse.emf.ecore.EObject getAlienPackage(org.eclipse.emf.ecore.EPackage ecorePackage)

getContentToFactoryMap

public java.util.Map<java.lang.String,org.eclipse.emf.ecore.resource.Resource.Factory> getContentToFactoryMap()

getEcoreEClassMap

public EClassMap getEcoreEClassMap(org.eclipse.emf.ecore.EClass ecoreEClass)

getEcorePackage

public org.eclipse.emf.ecore.EPackage getEcorePackage(org.eclipse.emf.ecore.EObject alienPackage)

getEcorePackages

public java.util.Collection<org.eclipse.emf.ecore.EPackage> getEcorePackages()

getEcoreEStructuralFeatureMap

public EStructuralFeatureMap<? extends org.eclipse.emf.ecore.EStructuralFeature> getEcoreEStructuralFeatureMap(org.eclipse.emf.ecore.EStructuralFeature ecoreFeature)

getFeatureMap

public EStructuralFeatureMap<? extends org.eclipse.emf.ecore.EStructuralFeature> getFeatureMap(org.eclipse.emf.ecore.EClass ecoreEClass,
                                                                                               org.eclipse.emf.ecore.EStructuralFeature ecoreFeature)

getName

public abstract java.lang.String getName()
Return a brief description of this meta data such "EMOF".

Returns:

getPackage

public org.eclipse.emf.ecore.EPackage getPackage(java.lang.String namespace)
Specified by:
getPackage in interface org.eclipse.emf.ecore.util.ExtendedMetaData
Overrides:
getPackage in class org.eclipse.emf.ecore.util.BasicExtendedMetaData

getXMIExtensions

public java.util.List<org.eclipse.emf.ecore.xml.type.AnyType> getXMIExtensions(org.eclipse.emf.ecore.EObject object)
Return a non-null list of AnyType objects that serve as Ecore extensions of object. (If object is an AnyType, then it is returned as its own extension).

Parameters:
object -
Returns:

getXMIExtensionsOrNull

public java.util.List<org.eclipse.emf.ecore.xml.type.AnyType> getXMIExtensionsOrNull(org.eclipse.emf.ecore.EObject object)
Return a possibly null list of AnyType objects that serve as Ecore extensions of object. (If object is an AnyType, then it is returned as its own extension).

Parameters:
object -
Returns:

getXMIExtensionValuesOrNull

public java.util.List<java.lang.Object> getXMIExtensionValuesOrNull(org.eclipse.emf.ecore.EObject object,
                                                                    java.lang.String featureName)

importEDataType

public org.eclipse.emf.ecore.EDataType importEDataType(org.eclipse.emf.ecore.EDataType alienEDataType)
Convert an EDataType used in an alien model to that used in an Ecore model.

Parameters:
ecoreValue -
Returns:

initialise

public void initialise()
                throws MappingConfigurationException
Throws:
MappingConfigurationException

putAdaptingFactory

public void putAdaptingFactory(org.eclipse.emf.ecore.EFactory adaptingFactory,
                               org.eclipse.emf.ecore.EFactory adaptedFactory)

putAdaptingPackage

public void putAdaptingPackage(org.eclipse.emf.ecore.EPackage adaptedEPackage)

validate

public org.eclipse.emf.ecore.EObject validate(java.io.PrintWriter writer)
Return null if all ecorePackages have an accurate set of class and feature map declarations. Return badly configured object with explanations to writer if not valid.