org.eclipse.xtend.backend.types.uml2
Class UmlTypesystem

java.lang.Object
  extended by org.eclipse.xtend.backend.types.uml2.UmlTypesystem
All Implemented Interfaces:
BackendTypesystem

public final class UmlTypesystem
extends java.lang.Object
implements BackendTypesystem

This typesystem implementation takes care of UML specifics, i.e. additional UML representations for primitive types and the mapping of UML stereotypes to backend types. It builds on top of the EmfTypesystem, which takes care of the "normal" mapping of UML elements to their corresponding types.
In other words, this typesystem implementation resolves all EMF types using the EmfTypesystem, so if you use UmlTypesystem, there is no need to use EmfTypesystem as well. But if you use both, make sure UmlTypesystem comes before EmfTypesystem.

Author:
Arno Haase (http://www.haase-consulting.com), André Arnold

Field Summary
static java.lang.String UNIQUE_REPRESENTATION_PREFIX
           
 
Constructor Summary
UmlTypesystem(java.util.Collection<org.eclipse.uml2.uml.Profile> profiles, boolean errorIfStereotypeIsMissing)
           
 
Method Summary
 BackendType findType(java.lang.Class<?> cls)
          returns the type for instances of a given class or, if this type system does not feel responsible, null.
 BackendType findType(java.lang.Object o)
          returns the type for a given object or, if this type system does not feel responsible, null.
 BackendType findType(java.lang.String uniqueRepresentation)
          returns the type corresponding with the unique representation.
static void fixName(org.eclipse.uml2.uml.NamedElement elem)
          replace all whitespace in the element's name by underscore characters
 BackendTypesystem getRootTypesystem()
           
 BackendType getTypeForEClassifier(org.eclipse.emf.ecore.EClassifier eClassifier)
           
 BackendType getTypeForStereotypeProperty(org.eclipse.uml2.uml.Type t)
           
static java.lang.String getUniqueIdentifier(org.eclipse.uml2.uml.NamedElement cls)
           
 void registerProfile(org.eclipse.uml2.uml.Profile profile)
           
 void setRootTypesystem(BackendTypesystem ts)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNIQUE_REPRESENTATION_PREFIX

public static final java.lang.String UNIQUE_REPRESENTATION_PREFIX
See Also:
Constant Field Values
Constructor Detail

UmlTypesystem

public UmlTypesystem(java.util.Collection<org.eclipse.uml2.uml.Profile> profiles,
                     boolean errorIfStereotypeIsMissing)
Method Detail

registerProfile

public void registerProfile(org.eclipse.uml2.uml.Profile profile)

fixName

public static void fixName(org.eclipse.uml2.uml.NamedElement elem)
replace all whitespace in the element's name by underscore characters


findType

public BackendType findType(java.lang.Object o)
Description copied from interface: BackendTypesystem
returns the type for a given object or, if this type system does not feel responsible, null.

Specified by:
findType in interface BackendTypesystem

getTypeForEClassifier

public BackendType getTypeForEClassifier(org.eclipse.emf.ecore.EClassifier eClassifier)

findType

public BackendType findType(java.lang.Class<?> cls)
Description copied from interface: BackendTypesystem
returns the type for instances of a given class or, if this type system does not feel responsible, null.

Specified by:
findType in interface BackendTypesystem

getRootTypesystem

public BackendTypesystem getRootTypesystem()
Specified by:
getRootTypesystem in interface BackendTypesystem

setRootTypesystem

public void setRootTypesystem(BackendTypesystem ts)
Specified by:
setRootTypesystem in interface BackendTypesystem

findType

public BackendType findType(java.lang.String uniqueRepresentation)
Description copied from interface: BackendTypesystem
returns the type corresponding with the unique representation. It is up to typesystem implementations to provide - and document - their respective naming schemes

Specified by:
findType in interface BackendTypesystem

getUniqueIdentifier

public static java.lang.String getUniqueIdentifier(org.eclipse.uml2.uml.NamedElement cls)

getTypeForStereotypeProperty

public BackendType getTypeForStereotypeProperty(org.eclipse.uml2.uml.Type t)