org.eclipse.ocl.examples.pivot.ecore
Class Ecore2Pivot
java.lang.Object
org.eclipse.ocl.examples.pivot.utilities.AbstractConversion
org.eclipse.ocl.examples.pivot.ecore.AbstractEcore2Pivot
org.eclipse.ocl.examples.pivot.ecore.Ecore2Pivot
- All Implemented Interfaces:
- org.eclipse.emf.common.notify.Adapter, org.eclipse.emf.common.notify.Adapter.Internal, MetaModelManagedAdapter, MetaModelManagerListener, PivotConstants, External2Pivot
- Direct Known Subclasses:
- UML2Ecore2Pivot
public class Ecore2Pivot
- extends AbstractEcore2Pivot
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter |
org.eclipse.emf.common.notify.Adapter.Internal |
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 |
Method Summary |
protected void |
addCreated(org.eclipse.emf.ecore.EObject eObject,
Element pivotElement)
|
void |
addGenericType(org.eclipse.emf.ecore.EGenericType eObject)
|
void |
addMapping(org.eclipse.emf.ecore.EObject eObject,
Element pivotElement)
|
protected org.eclipse.emf.common.util.URI |
createPivotURI()
|
void |
dispose()
|
void |
error(java.lang.String message)
|
static Ecore2Pivot |
findAdapter(org.eclipse.emf.ecore.resource.Resource resource,
MetaModelManager metaModelManager)
|
static Ecore2Pivot |
getAdapter(org.eclipse.emf.ecore.resource.Resource resource,
MetaModelManager metaModelManager)
|
protected org.eclipse.emf.common.util.URI |
getBaseURI(org.eclipse.emf.ecore.resource.Resource ecoreResource)
Return the baseURI of ecoreResource against which its imports should be resolved. |
|
getCreated(java.lang.Class<T> requiredClass,
org.eclipse.emf.ecore.EObject eObject)
|
java.util.Map<org.eclipse.emf.ecore.EClassifier,Type> |
getEcore2PivotMap()
|
org.eclipse.emf.ecore.resource.Resource |
getEcoreResource()
|
|
getPivotElement(java.lang.Class<T> requiredClass,
org.eclipse.emf.ecore.EObject eObject)
|
|
getPivotOfEcore(java.lang.Class<T> requiredClass,
org.eclipse.emf.ecore.EObject eObject)
|
Root |
getPivotRoot()
|
Type |
getPivotType(org.eclipse.emf.ecore.EObject eObject)
|
org.eclipse.emf.ecore.resource.Resource |
getResource()
|
org.eclipse.emf.common.notify.Notifier |
getTarget()
|
org.eclipse.emf.common.util.URI |
getURI()
|
static Element |
importFromEcore(MetaModelManager metaModelManager,
java.lang.String alias,
org.eclipse.emf.ecore.EObject eObject)
Convert an (annotated) Ecore object to a pivot element. |
static Root |
importFromEcore(MetaModelManager metaModelManager,
java.lang.String alias,
org.eclipse.emf.ecore.resource.Resource ecoreResource)
Convert an (annotated) Ecore resource to a Pivot Model. |
Root |
importObjects(java.util.Collection<org.eclipse.emf.ecore.EObject> ecoreContents,
org.eclipse.emf.common.util.URI pivotURI)
|
void |
initializeEcore2PivotMap()
|
protected void |
installImports()
|
boolean |
isAdapterFor(MetaModelManager metaModelManager)
|
boolean |
isAdapterForType(java.lang.Object type)
|
static boolean |
isEcore(org.eclipse.emf.ecore.resource.Resource resource)
|
protected org.eclipse.emf.ecore.EPackage |
isLibrary(java.util.Collection<org.eclipse.emf.ecore.EObject> ecoreContents)
|
protected boolean |
isPivot(java.util.Collection<org.eclipse.emf.ecore.EObject> ecoreContents)
|
static Ecore2Pivot |
loadFromEcore(ASResource ecoreASResource,
org.eclipse.emf.common.util.URI ecoreURI)
|
protected void |
loadImports(org.eclipse.emf.ecore.EPackage ePackage,
org.eclipse.emf.common.util.URI baseURI)
|
protected void |
loadImports(org.eclipse.emf.ecore.resource.Resource ecoreResource)
Load all transitively referenced *.ecore files and identify any EPackages identified
as OCL AS Metamodels. |
void |
metaModelManagerDisposed(MetaModelManager metaModelManager)
Respond to disposal of the MetaModelManager by eliminating all further usage. |
void |
notifyChanged(org.eclipse.emf.common.notify.Notification notification)
|
void |
queueReference(org.eclipse.emf.ecore.EObject eObject)
|
|
refreshElement(java.lang.Class<T> pivotClass,
org.eclipse.emf.ecore.EClass pivotEClass,
org.eclipse.emf.ecore.EModelElement eModelElement)
|
protected Type |
resolveDataType(org.eclipse.emf.ecore.EDataType eClassifier)
|
protected Type |
resolveGenericType(java.util.Map<java.lang.String,Type> resolvedSpecializations,
org.eclipse.emf.ecore.EGenericType eGenericType)
|
protected Type |
resolveSimpleType(org.eclipse.emf.ecore.EClassifier eClassifier)
|
protected Type |
resolveType(java.util.Map<java.lang.String,Type> resolvedSpecializations,
org.eclipse.emf.ecore.EGenericType eGenericType)
|
protected Type |
resolveTypeParameter(org.eclipse.emf.ecore.EGenericType eGenericType)
|
protected Type |
resolveWildcardType(org.eclipse.emf.ecore.EGenericType eGenericType)
|
void |
setEcoreURI(org.eclipse.emf.common.util.URI ecoreURI)
|
void |
setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
|
java.lang.String |
toString()
|
void |
unsetTarget(org.eclipse.emf.common.notify.Notifier oldTarget)
|
void |
update(org.eclipse.emf.ecore.resource.Resource asResource,
java.util.Collection<org.eclipse.emf.ecore.EObject> ecoreContents)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ecoreResource
@NonNull
protected final org.eclipse.emf.ecore.resource.Resource ecoreResource
pivotRoot
protected Root pivotRoot
declarationPass
protected final Ecore2PivotDeclarationSwitch declarationPass
referencePass
protected final Ecore2PivotReferenceSwitch referencePass
Ecore2Pivot
public Ecore2Pivot(@NonNull
org.eclipse.emf.ecore.resource.Resource ecoreResource,
@Nullable
MetaModelManager metaModelManager)
findAdapter
@Nullable
public static Ecore2Pivot findAdapter(@NonNull
org.eclipse.emf.ecore.resource.Resource resource,
@NonNull
MetaModelManager metaModelManager)
getAdapter
public static Ecore2Pivot getAdapter(@NonNull
org.eclipse.emf.ecore.resource.Resource resource,
@Nullable
MetaModelManager metaModelManager)
importFromEcore
@NonNull
public static Root importFromEcore(@NonNull
MetaModelManager metaModelManager,
java.lang.String alias,
@NonNull
org.eclipse.emf.ecore.resource.Resource ecoreResource)
- Convert an (annotated) Ecore resource to a Pivot Model.
- Parameters:
alias
- ecoreResource
- the annotated Ecore resource
- Returns:
- the Pivot root package
isEcore
public static boolean isEcore(@NonNull
org.eclipse.emf.ecore.resource.Resource resource)
loadFromEcore
public static Ecore2Pivot loadFromEcore(@NonNull
ASResource ecoreASResource,
@NonNull
org.eclipse.emf.common.util.URI ecoreURI)
importFromEcore
public static Element importFromEcore(@NonNull
MetaModelManager metaModelManager,
java.lang.String alias,
@NonNull
org.eclipse.emf.ecore.EObject eObject)
- Convert an (annotated) Ecore object to a pivot element.
- Parameters:
eObject
- the annotated Ecore object
- Returns:
- the pivot element
addCreated
protected void addCreated(org.eclipse.emf.ecore.EObject eObject,
Element pivotElement)
addGenericType
public void addGenericType(@NonNull
org.eclipse.emf.ecore.EGenericType eObject)
- Specified by:
addGenericType
in class AbstractEcore2Pivot
addMapping
public void addMapping(@NonNull
org.eclipse.emf.ecore.EObject eObject,
@NonNull
Element pivotElement)
- Specified by:
addMapping
in class AbstractEcore2Pivot
createPivotURI
@NonNull
protected org.eclipse.emf.common.util.URI createPivotURI()
dispose
public void dispose()
error
public void error(@Nullable
java.lang.String message)
- Specified by:
error
in class AbstractEcore2Pivot
getBaseURI
@Nullable
protected org.eclipse.emf.common.util.URI getBaseURI(@NonNull
org.eclipse.emf.ecore.resource.Resource ecoreResource)
- Return the baseURI of ecoreResource against which its imports should be resolved.
getCreated
@Nullable
public <T extends Element> T getCreated(@NonNull
java.lang.Class<T> requiredClass,
@NonNull
org.eclipse.emf.ecore.EObject eObject)
getEcore2PivotMap
@NonNull
public java.util.Map<org.eclipse.emf.ecore.EClassifier,Type> getEcore2PivotMap()
getEcoreResource
@Nullable
public org.eclipse.emf.ecore.resource.Resource getEcoreResource()
getPivotOfEcore
@Nullable
public <T extends Element> T getPivotOfEcore(@NonNull
java.lang.Class<T> requiredClass,
@NonNull
org.eclipse.emf.ecore.EObject eObject)
getPivotElement
public <T extends Element> T getPivotElement(@NonNull
java.lang.Class<T> requiredClass,
@NonNull
org.eclipse.emf.ecore.EObject eObject)
getPivotType
public Type getPivotType(@NonNull
org.eclipse.emf.ecore.EObject eObject)
getPivotRoot
@NonNull
public Root getPivotRoot()
getResource
@Nullable
public org.eclipse.emf.ecore.resource.Resource getResource()
getTarget
@Nullable
public org.eclipse.emf.common.notify.Notifier getTarget()
getURI
@NonNull
public org.eclipse.emf.common.util.URI getURI()
importObjects
@NonNull
public Root importObjects(@NonNull
java.util.Collection<org.eclipse.emf.ecore.EObject> ecoreContents,
@NonNull
org.eclipse.emf.common.util.URI pivotURI)
initializeEcore2PivotMap
public void initializeEcore2PivotMap()
installImports
protected void installImports()
isAdapterFor
public boolean isAdapterFor(@NonNull
MetaModelManager metaModelManager)
isAdapterForType
public boolean isAdapterForType(java.lang.Object type)
isLibrary
protected org.eclipse.emf.ecore.EPackage isLibrary(@NonNull
java.util.Collection<org.eclipse.emf.ecore.EObject> ecoreContents)
isPivot
protected boolean isPivot(@NonNull
java.util.Collection<org.eclipse.emf.ecore.EObject> ecoreContents)
loadImports
protected void loadImports(@NonNull
org.eclipse.emf.ecore.resource.Resource ecoreResource)
- Load all transitively referenced *.ecore files and identify any EPackages identified
as OCL AS Metamodels.
loadImports
protected void loadImports(@NonNull
org.eclipse.emf.ecore.EPackage ePackage,
@Nullable
org.eclipse.emf.common.util.URI baseURI)
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)
queueReference
public void queueReference(@NonNull
org.eclipse.emf.ecore.EObject eObject)
- Specified by:
queueReference
in class AbstractEcore2Pivot
refreshElement
@NonNull
public <T extends NamedElement> T refreshElement(@NonNull
java.lang.Class<T> pivotClass,
org.eclipse.emf.ecore.EClass pivotEClass,
@NonNull
org.eclipse.emf.ecore.EModelElement eModelElement)
- Overrides:
refreshElement
in class AbstractEcore2Pivot
resolveDataType
protected Type resolveDataType(@NonNull
org.eclipse.emf.ecore.EDataType eClassifier)
resolveGenericType
protected Type resolveGenericType(@NonNull
java.util.Map<java.lang.String,Type> resolvedSpecializations,
@NonNull
org.eclipse.emf.ecore.EGenericType eGenericType)
resolveSimpleType
protected Type resolveSimpleType(@NonNull
org.eclipse.emf.ecore.EClassifier eClassifier)
resolveType
protected Type resolveType(@NonNull
java.util.Map<java.lang.String,Type> resolvedSpecializations,
@NonNull
org.eclipse.emf.ecore.EGenericType eGenericType)
resolveTypeParameter
protected Type resolveTypeParameter(@NonNull
org.eclipse.emf.ecore.EGenericType eGenericType)
resolveWildcardType
protected Type resolveWildcardType(@NonNull
org.eclipse.emf.ecore.EGenericType eGenericType)
setEcoreURI
public void setEcoreURI(org.eclipse.emf.common.util.URI ecoreURI)
setTarget
public void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
unsetTarget
public void unsetTarget(org.eclipse.emf.common.notify.Notifier oldTarget)
update
public void update(@NonNull
org.eclipse.emf.ecore.resource.Resource asResource,
@NonNull
java.util.Collection<org.eclipse.emf.ecore.EObject> ecoreContents)