org.eclipse.xtend.typesystem.uml2.profile
Class ProfileMetaModel

java.lang.Object
  extended by org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel
All Implemented Interfaces:
MetaModel

public class ProfileMetaModel
extends java.lang.Object
implements MetaModel

The ProfileMetaModel maps Stereotypes defined in UML profiles to virtual types that extend the base UML metaclasses. Use this MetaModel implementation when using profiled UML models.

Workflow configuration

Instantiate one ProfileMetaModel instance in your workflow and add one or more profile URIs.
 <bean id="mm_profile" class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel">
   <profile value="platform:/resource/yourproject/path/to/The.profile.uml"/>
   <profile value="platform:/resource/yourproject/path/to/Another.profile.uml"/>
 </bean>
 ...
 <component class="org.eclipse.xpand2.Generator">
    <metaModel idRef="mm_profile"/>
    ...
 </component>
 
Use the ProfileMetaModel always as first metaModel registration for expression using workflow components (Generator, XtendComponent, etc.). It is not necessary to add an instance of UML2MetaModel or EmfRegistryMetaModel additionally, since the ProfileMetaModel delegates to those metamodel implementations when it is not responsible for resolving a type.

Author:
karsten.thoms@itemis.de, Moritz@Eysholdt.de

Nested Class Summary
static class ProfileMetaModel.ProfilesUMLUtil
           
 
Field Summary
 java.util.List<org.eclipse.uml2.uml.Profile> profiles
           
 
Constructor Summary
ProfileMetaModel()
           
ProfileMetaModel(org.eclipse.uml2.uml.Profile... profiles)
           
 
Method Summary
 void addProfile(java.lang.String profile)
           
 java.lang.String getFullName(org.eclipse.uml2.uml.Type type)
           
 java.util.Set<Type> getKnownTypes()
          returns all types this metamodel is responsible for
 java.lang.String getName()
           
 java.util.Set<java.lang.String> getNamespaces()
          Returns all namespaces provided by this metamodel.
 Type getType(java.lang.Object obj)
          if this metamodel is responsible for a types which are responsible for the given object, it returns the corresponding type.
 Type getTypeForName(java.lang.String typeName)
          if this metamodel is responsible for a type with the given name, it returns the corresponding type.
 TypeSystem getTypeSystem()
          Returns the underlying typesystem.
 void reloadMetaModel(java.util.List<org.eclipse.uml2.uml.Profile> profiles)
          Reloads this meta model by cleaning all cached and stereotype information and re-initializing them with the given profiles.
 void setErrorIfStereotypeMissing(boolean errorIfStereotypeMissing)
           
 void setTypeSystem(TypeSystem typeSystem)
          Sets the underlying typesystem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

profiles

public java.util.List<org.eclipse.uml2.uml.Profile> profiles
Constructor Detail

ProfileMetaModel

public ProfileMetaModel()

ProfileMetaModel

public ProfileMetaModel(org.eclipse.uml2.uml.Profile... profiles)
Method Detail

setErrorIfStereotypeMissing

public void setErrorIfStereotypeMissing(boolean errorIfStereotypeMissing)

addProfile

public void addProfile(java.lang.String profile)

reloadMetaModel

public void reloadMetaModel(java.util.List<org.eclipse.uml2.uml.Profile> profiles)
Reloads this meta model by cleaning all cached and stereotype information and re-initializing them with the given profiles.

Since:
2.0

getFullName

public java.lang.String getFullName(org.eclipse.uml2.uml.Type type)

getTypeForName

public Type getTypeForName(java.lang.String typeName)
Description copied from interface: MetaModel
if this metamodel is responsible for a type with the given name, it returns the corresponding type. Otherwise returns null

Specified by:
getTypeForName in interface MetaModel
Parameters:
typeName - name of type
Returns:
the corresponding type

getType

public Type getType(java.lang.Object obj)
Description copied from interface: MetaModel
if this metamodel is responsible for a types which are responsible for the given object, it returns the corresponding type. Otherwise returns null

Specified by:
getType in interface MetaModel
Parameters:
obj - object for which a corresponding object is requested
Returns:
the corresponding type

getKnownTypes

public java.util.Set<Type> getKnownTypes()
Description copied from interface: MetaModel
returns all types this metamodel is responsible for

Specified by:
getKnownTypes in interface MetaModel
Returns:
set of known types

getTypeSystem

public TypeSystem getTypeSystem()
Description copied from interface: MetaModel
Returns the underlying typesystem.

Specified by:
getTypeSystem in interface MetaModel
Returns:
the typesystem

setTypeSystem

public void setTypeSystem(TypeSystem typeSystem)
Description copied from interface: MetaModel
Sets the underlying typesystem.

Specified by:
setTypeSystem in interface MetaModel
Parameters:
typeSystem - the typesystem

getName

public java.lang.String getName()

getNamespaces

public java.util.Set<java.lang.String> getNamespaces()
Description copied from interface: MetaModel
Returns all namespaces provided by this metamodel.

Specified by:
getNamespaces in interface MetaModel
Returns:
A Set containing the names of all namespaces provided by this metamodel.
See Also:
MetaModel.getNamespaces()