org.eclipse.ocl.examples.pivot.uml
Class UML2Pivot

java.lang.Object
  extended by org.eclipse.ocl.examples.pivot.utilities.AbstractConversion
      extended by org.eclipse.ocl.examples.pivot.ecore.AbstractEcore2Pivot
          extended by org.eclipse.ocl.examples.pivot.uml.UML2Pivot
All Implemented Interfaces:
org.eclipse.emf.common.notify.Adapter, org.eclipse.emf.common.notify.Adapter.Internal, MetaModelManagedAdapter, MetaModelManagerListener, PivotConstants, External2Pivot
Direct Known Subclasses:
UML2Pivot.Inner, UML2Pivot.Outer

public abstract class UML2Pivot
extends AbstractEcore2Pivot


Nested Class Summary
static class UML2Pivot.Inner
          A UML2Pivot$Inner adapts an unconverted UML resource that has been imported during the conversion of some other UML resource.
static class UML2Pivot.Outer
          A UML2Pivot$Outer adapts an unconverted UML resource and hosts the additional conversions necessary for imported UML resources.
 
Nested classes/interfaces inherited from class org.eclipse.ocl.examples.pivot.utilities.AbstractConversion
AbstractConversion.Predicate<T extends org.eclipse.emf.ecore.EObject>
 
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
org.eclipse.emf.common.notify.Adapter.Internal
 
Field Summary
static TracingOption ADD_ELEMENT_EXTENSION
           
static TracingOption ADD_IMPORTED_RESOURCE
           
static TracingOption ADD_PROFILE_APPLICATION
           
static TracingOption ADD_STEREOTYPE_APPLICATION
           
static TracingOption ADD_TYPE_EXTENSION
           
static TracingOption APPLICABLE_STEREOTYPES
           
static TracingOption CONVERT_RESOURCE
           
protected  Root pivotRoot
           
static java.lang.String STEREOTYPE_BASE_PREFIX
           
static java.lang.String STEREOTYPE_EXTENSION_PREFIX
           
static TracingOption TYPE_EXTENSIONS
           
protected  org.eclipse.emf.ecore.resource.Resource umlResource
           
 
Fields inherited from class org.eclipse.ocl.examples.pivot.utilities.AbstractConversion
metaModelManager
 
Fields inherited from interface org.eclipse.ocl.examples.pivot.PivotConstants
ACCUMULATOR_SEPARATOR, ANNOTATED_IMPLICIT_OPPOSITE_LOWER_VALUE, ANNOTATED_IMPLICIT_OPPOSITE_ORDERED, ANNOTATED_IMPLICIT_OPPOSITE_UNIQUE, ANNOTATED_IMPLICIT_OPPOSITE_UPPER_VALUE, ANNOTATION_QUOTE, AS_LIBRARY_ANNOTATION_SOURCE, AS_METAMODEL_ANNOTATION_SOURCE, BINDINGS_PREFIX, COLLECTION_NAVIGATION_OPERATOR, DEFAULT_IMPLICIT_OPPOSITE_LOWER_VALUE, DEFAULT_IMPLICIT_OPPOSITE_ORDERED, DEFAULT_IMPLICIT_OPPOSITE_UNIQUE, DEFAULT_IMPLICIT_OPPOSITE_UPPER_VALUE, DOCUMENTATION_ANNOTATION_KEY, DOCUMENTATION_ANNOTATION_SOURCE, DOT_OCL_AS_FILE_EXTENSION, DUPLICATES_ANNOTATION_SOURCE, GEN_MODEL_URI, GREATER_THAN_OPERATOR, GREATER_THAN_OR_EQUAL_OPERATOR, IMPORT_ANNOTATION_SOURCE, ITERATOR_SEPARATOR, LESS_THAN_OPERATOR, LESS_THAN_OR_EQUAL_OPERATOR, LIBRARY_MONIKER_PREFIX, MESSAGE_ANNOTATION_DETAIL_SUFFIX, MESSAGE_PART_NAME, MONIKER_EXP_CHILD_PREFIX, MONIKER_IF_EXP, MONIKER_INVALID_LITERAL_EXP, MONIKER_LET_EXP, MONIKER_NULL_LITERAL_EXP, MONIKER_OPERATOR_SEPARATOR, MONIKER_OVERFLOW_LIMIT, MONIKER_PART_SEPARATOR, MONIKER_ROOT, MONIKER_ROOT_EXP, MONIKER_SCOPE_SEPARATOR, MONIKER_STRING_LITERAL_EXP, MONIKER_TUPLE_LITERAL_EXP, MONIKER_UNLIMITED_NATURAL_LITERAL_EXP, NULL_MARKER, NULL_ROOT, OBJECT_NAVIGATION_OPERATOR, OCL_AS_FILE_EXTENSION, OCL_LANGUAGE, OCL_NAME, OMG_OCL_ANNOTATION_SOURCE, ORPHANAGE_NAME, ORPHANAGE_PREFIX, ORPHANAGE_URI, OVERFLOW_MARKER, PARAMETER_PREFIX, PARAMETER_SEPARATOR, PARAMETER_SUFFIX, PIVOT_ECORE, PLUGIN_ID, PRECEDENCE_PREFIX, PRIMITIVE_TYPES_URI_PREFIX, REDEFINES_ANNOTATION_SOURCE, roleNames, SEVERITY_PART_NAME, STATUS_PART_NAME, SYSML_ANNOTATION_SOURCE, TEMPLATE_BINDING_PREFIX, TEMPLATE_BINDING_SEPARATOR, TEMPLATE_BINDING_SUFFIX, TEMPLATE_PARAMETER_PREFIX, TEMPLATE_SIGNATURE_PREFIX, TEMPLATE_SIGNATURE_SEPARATOR, TEMPLATE_SIGNATURE_SUFFIX, TUPLE_SIGNATURE_PART_SEPARATOR, TUPLE_SIGNATURE_PREFIX, TUPLE_SIGNATURE_SUFFIX, TUPLE_SIGNATURE_TYPE_SEPARATOR, UNKNOWN_TYPE_TEXT, UNRESOLVED_PROXY_MARKER, WILDCARD_INDICATOR, WILDCARD_NAME
 
Constructor Summary
protected UML2Pivot(org.eclipse.emf.ecore.resource.Resource umlResource, MetaModelManager metaModelManager)
           
 
Method Summary
abstract  void addCreated(org.eclipse.emf.ecore.EObject umlElement, Element pivotElement)
           
 void addImportedPackage(org.eclipse.uml2.uml.Package importedPackage)
           
 void addImportedPackages(java.util.List<? extends org.eclipse.uml2.uml.Package> importedPackages)
           
abstract  void addImportedResource(org.eclipse.emf.ecore.resource.Resource importedResource)
           
abstract  void addProfileApplication(ProfileApplication asProfileApplication)
           
abstract  void addProperty(Type asType, Property asProperty)
           
abstract  void addStereotype(Stereotype asStereotype)
           
abstract  void addStereotypeApplication(org.eclipse.emf.ecore.EObject stereotypeApplication)
           
abstract  void addTypeExtension(TypeExtension asTypeExtension)
           
protected  org.eclipse.emf.common.util.URI createPivotURI()
           
 void dispose()
           
abstract  void error(java.lang.String message)
           
static UML2Pivot findAdapter(org.eclipse.emf.ecore.resource.Resource resource, MetaModelManager metaModelManager)
           
static UML2Pivot getAdapter(org.eclipse.emf.ecore.resource.Resource resource, MetaModelManager metaModelManager)
           
abstract
<T extends Element>
T
getCreated(java.lang.Class<T> requiredClass, org.eclipse.emf.ecore.EObject eObject)
           
abstract  UML2PivotDeclarationSwitch getDeclarationPass()
           
abstract  Root getPivotRoot()
           
abstract  Type getPivotType(org.eclipse.emf.ecore.EObject eObject)
           
 org.eclipse.emf.ecore.resource.Resource getResource()
           
abstract  UML2Pivot.Outer getRoot()
           
 org.eclipse.emf.common.notify.Notifier getTarget()
           
 org.eclipse.emf.common.util.URI getURI()
           
static Element importFromUML(MetaModelManager metaModelManager, java.lang.String alias, org.eclipse.emf.ecore.EObject eObject)
          Convert a UML object to a pivot element.
static Root importFromUML(MetaModelManager metaModelManager, java.lang.String alias, org.eclipse.emf.ecore.resource.Resource umlResource)
          Convert a UML resource to a Pivot Model.
static java.lang.String initialize(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
          Initialize registries to support OCL and UML usage.
static java.lang.String initialize(StandaloneProjectMap projectMap)
           
protected  Root installDeclarations(org.eclipse.emf.ecore.resource.Resource asResource)
           
 boolean isAdapterFor(MetaModelManager metaModelManager)
           
 boolean isAdapterForType(java.lang.Object type)
           
protected  boolean isPivot(java.util.Collection<org.eclipse.emf.ecore.EObject> umlContents)
           
static boolean isUML(org.eclipse.emf.ecore.resource.Resource resource)
           
static UML2Pivot loadFromUML(ASResource umlASResource, org.eclipse.emf.common.util.URI umlURI)
           
 void metaModelManagerDisposed(MetaModelManager metaModelManager)
          Respond to disposal of the MetaModelManager by eliminating all further usage.
 void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
           
abstract  void queueUse(org.eclipse.emf.ecore.EObject eObject)
           
protected
<T extends Element>
T
refreshElement(java.lang.Class<T> pivotClass, org.eclipse.emf.ecore.EClass pivotEClass, org.eclipse.emf.ecore.EObject umlElement)
           
protected
<T extends NamedElement>
T
refreshNamedElement(java.lang.Class<T> pivotClass, org.eclipse.emf.ecore.EClass pivotEClass, org.eclipse.uml2.uml.NamedElement umlNamedElement)
           
 Stereotype resolveStereotype(org.eclipse.emf.ecore.EObject umlStereotypeApplication, java.util.List<org.eclipse.uml2.uml.Element> umlStereotypedElements)
          Return the UML Stereotype referenced by the UML stereotype application to some UML Stereotyped Elements.
protected  Type resolveType(org.eclipse.uml2.uml.Type umlType)
           
protected  Type resolveTypeParameter(org.eclipse.emf.ecore.EGenericType eGenericType)
           
protected  Type resolveWildcardType(org.eclipse.emf.ecore.EGenericType eGenericType)
           
protected  void setOriginalMapping(Element pivotElement, org.eclipse.emf.ecore.EObject umlElement)
           
 void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
           
 void setUMLURI(org.eclipse.emf.common.util.URI umlURI)
           
 java.lang.String toString()
           
 void unsetTarget(org.eclipse.emf.common.notify.Notifier oldTarget)
           
 
Methods inherited from class org.eclipse.ocl.examples.pivot.ecore.AbstractEcore2Pivot
addGenericType, addMapping, getOriginalName, isInvariant, queueReference, refreshElement, refreshNamedElement
 
Methods inherited from class org.eclipse.ocl.examples.pivot.utilities.AbstractConversion
basicGet, getEPackage, getMetaModelManager, isId, refreshList, refreshSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ADD_ELEMENT_EXTENSION

@NonNull
public static final TracingOption ADD_ELEMENT_EXTENSION

ADD_IMPORTED_RESOURCE

@NonNull
public static final TracingOption ADD_IMPORTED_RESOURCE

ADD_PROFILE_APPLICATION

@NonNull
public static final TracingOption ADD_PROFILE_APPLICATION

ADD_STEREOTYPE_APPLICATION

@NonNull
public static final TracingOption ADD_STEREOTYPE_APPLICATION

ADD_TYPE_EXTENSION

@NonNull
public static final TracingOption ADD_TYPE_EXTENSION

APPLICABLE_STEREOTYPES

@NonNull
public static final TracingOption APPLICABLE_STEREOTYPES

CONVERT_RESOURCE

@NonNull
public static final TracingOption CONVERT_RESOURCE

TYPE_EXTENSIONS

@NonNull
public static final TracingOption TYPE_EXTENSIONS

STEREOTYPE_BASE_PREFIX

@NonNull
public static final java.lang.String STEREOTYPE_BASE_PREFIX
See Also:
Constant Field Values

STEREOTYPE_EXTENSION_PREFIX

@NonNull
public static final java.lang.String STEREOTYPE_EXTENSION_PREFIX
See Also:
Constant Field Values

umlResource

@NonNull
protected final org.eclipse.emf.ecore.resource.Resource umlResource

pivotRoot

protected Root pivotRoot
Constructor Detail

UML2Pivot

protected UML2Pivot(@NonNull
                    org.eclipse.emf.ecore.resource.Resource umlResource,
                    @NonNull
                    MetaModelManager metaModelManager)
Method Detail

findAdapter

@Nullable
public static UML2Pivot findAdapter(@NonNull
                                             org.eclipse.emf.ecore.resource.Resource resource,
                                             @NonNull
                                             MetaModelManager metaModelManager)

getAdapter

@NonNull
public static UML2Pivot getAdapter(@NonNull
                                           org.eclipse.emf.ecore.resource.Resource resource,
                                           @Nullable
                                           MetaModelManager metaModelManager)

importFromUML

public static Root importFromUML(@NonNull
                                 MetaModelManager metaModelManager,
                                 java.lang.String alias,
                                 org.eclipse.emf.ecore.resource.Resource umlResource)
                          throws ParserException
Convert a UML resource to a Pivot Model.

Parameters:
alias -
umlResource - the UML resource
Returns:
the Pivot root package
Throws:
ParserException

importFromUML

public static Element importFromUML(@NonNull
                                    MetaModelManager metaModelManager,
                                    java.lang.String alias,
                                    org.eclipse.emf.ecore.EObject eObject)
                             throws ParserException
Convert a UML object to a pivot element.

Parameters:
eObject - the UML object
Returns:
the pivot element
Throws:
ParserException

initialize

public static java.lang.String initialize(@NonNull
                                          org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Initialize registries to support OCL and UML usage. This method is intended for initialization of standalone behaviors for which plugin extension registrations have not been applied.

A null resourceSet may be provided to initialize the global package registry and global URI mapping registry.

A non-null resourceSet may be provided to identify specific package and global URI mapping registries.

This method is used to configure the ResourceSet used to load the OCL Standard Library.

Parameters:
resourceSet - to be initialized or null for global initialization
Returns:
a failure reason, null if successful

initialize

public static java.lang.String initialize(@NonNull
                                          StandaloneProjectMap projectMap)

isUML

public static boolean isUML(@NonNull
                            org.eclipse.emf.ecore.resource.Resource resource)

loadFromUML

public static UML2Pivot loadFromUML(@NonNull
                                    ASResource umlASResource,
                                    @NonNull
                                    org.eclipse.emf.common.util.URI umlURI)

addCreated

public abstract void addCreated(@NonNull
                                org.eclipse.emf.ecore.EObject umlElement,
                                @NonNull
                                Element pivotElement)

addImportedPackage

public void addImportedPackage(@NonNull
                               org.eclipse.uml2.uml.Package importedPackage)

addImportedPackages

public void addImportedPackages(@NonNull
                                java.util.List<? extends org.eclipse.uml2.uml.Package> importedPackages)

addImportedResource

public abstract void addImportedResource(@NonNull
                                         org.eclipse.emf.ecore.resource.Resource importedResource)

addProfileApplication

public abstract void addProfileApplication(@NonNull
                                           ProfileApplication asProfileApplication)

addProperty

public abstract void addProperty(@NonNull
                                 Type asType,
                                 @NonNull
                                 Property asProperty)

addStereotype

public abstract void addStereotype(@NonNull
                                   Stereotype asStereotype)

addStereotypeApplication

public abstract void addStereotypeApplication(@NonNull
                                              org.eclipse.emf.ecore.EObject stereotypeApplication)

addTypeExtension

public abstract void addTypeExtension(@NonNull
                                      TypeExtension asTypeExtension)

createPivotURI

@NonNull
protected org.eclipse.emf.common.util.URI createPivotURI()

dispose

public void dispose()

error

public abstract void error(@NonNull
                           java.lang.String message)
Specified by:
error in class AbstractEcore2Pivot

getCreated

@Nullable
public abstract <T extends Element> T getCreated(@NonNull
                                                          java.lang.Class<T> requiredClass,
                                                          @NonNull
                                                          org.eclipse.emf.ecore.EObject eObject)

getDeclarationPass

@NonNull
public abstract UML2PivotDeclarationSwitch getDeclarationPass()

getPivotRoot

@NonNull
public abstract Root getPivotRoot()
                           throws ParserException
Throws:
ParserException

getPivotType

@Nullable
public abstract Type getPivotType(@NonNull
                                           org.eclipse.emf.ecore.EObject eObject)

getResource

@NonNull
public org.eclipse.emf.ecore.resource.Resource getResource()

getRoot

@NonNull
public abstract UML2Pivot.Outer getRoot()

getTarget

@NonNull
public org.eclipse.emf.common.notify.Notifier getTarget()

getURI

@NonNull
public org.eclipse.emf.common.util.URI getURI()

installDeclarations

@NonNull
protected Root installDeclarations(@NonNull
                                           org.eclipse.emf.ecore.resource.Resource asResource)

isAdapterFor

public boolean isAdapterFor(@NonNull
                            MetaModelManager metaModelManager)

isAdapterForType

public boolean isAdapterForType(java.lang.Object type)

isPivot

protected boolean isPivot(@NonNull
                          java.util.Collection<org.eclipse.emf.ecore.EObject> umlContents)

metaModelManagerDisposed

public void metaModelManagerDisposed(@NonNull
                                     MetaModelManager metaModelManager)
Description copied from interface: MetaModelManagerListener
Respond to disposal of the MetaModelManager by eliminating all further usage.


notifyChanged

public void notifyChanged(org.eclipse.emf.common.notify.Notification notification)

queueUse

public abstract void queueUse(@NonNull
                              org.eclipse.emf.ecore.EObject eObject)

refreshElement

protected <T extends Element> T refreshElement(@NonNull
                                               java.lang.Class<T> pivotClass,
                                               org.eclipse.emf.ecore.EClass pivotEClass,
                                               @NonNull
                                               org.eclipse.emf.ecore.EObject umlElement)

refreshNamedElement

@NonNull
protected <T extends NamedElement> T refreshNamedElement(@NonNull
                                                                 java.lang.Class<T> pivotClass,
                                                                 org.eclipse.emf.ecore.EClass pivotEClass,
                                                                 @NonNull
                                                                 org.eclipse.uml2.uml.NamedElement umlNamedElement)

resolveStereotype

@Nullable
public Stereotype resolveStereotype(@NonNull
                                             org.eclipse.emf.ecore.EObject umlStereotypeApplication,
                                             @NonNull
                                             java.util.List<org.eclipse.uml2.uml.Element> umlStereotypedElements)
Return the UML Stereotype referenced by the UML stereotype application to some UML Stereotyped Elements.

Note that the reference in the UML Stereotype application is to a particular Ecore version of the Profile, rather than to the UML profile, so we have to locate the UML profile by URI and name.


resolveType

@Nullable
protected Type resolveType(@NonNull
                                    org.eclipse.uml2.uml.Type umlType)

resolveTypeParameter

@Nullable
protected Type resolveTypeParameter(@NonNull
                                             org.eclipse.emf.ecore.EGenericType eGenericType)

resolveWildcardType

@Nullable
protected Type resolveWildcardType(@NonNull
                                            org.eclipse.emf.ecore.EGenericType eGenericType)

setOriginalMapping

protected void setOriginalMapping(@NonNull
                                  Element pivotElement,
                                  @NonNull
                                  org.eclipse.emf.ecore.EObject umlElement)

setTarget

public void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)

setUMLURI

public void setUMLURI(org.eclipse.emf.common.util.URI umlURI)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

unsetTarget

public void unsetTarget(org.eclipse.emf.common.notify.Notifier oldTarget)