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

java.lang.Object
  extended by org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl
      extended by org.eclipse.ocl.examples.pivot.resource.AbstractASResourceFactory
          extended by org.eclipse.ocl.examples.pivot.uml.UMLASResourceFactory
All Implemented Interfaces:
org.eclipse.emf.ecore.resource.Resource.Factory, ASResourceFactory

public final class UMLASResourceFactory
extends AbstractASResourceFactory


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.resource.Resource.Factory
org.eclipse.emf.ecore.resource.Resource.Factory.Descriptor, org.eclipse.emf.ecore.resource.Resource.Factory.Registry
 
Field Summary
static UMLASResourceFactory INSTANCE
           
 
Fields inherited from class org.eclipse.ocl.examples.pivot.resource.AbstractASResourceFactory
contentType, fileExtension
 
Fields inherited from interface org.eclipse.ocl.examples.pivot.resource.ASResourceFactory
CAN_HANDLE, CANNOT_HANDLE, MAY_HANDLE
 
Constructor Summary
protected UMLASResourceFactory()
           
 
Method Summary
 void configure(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
          Configure the MetaModelManager's external ResourceSet.
 org.eclipse.emf.ecore.resource.Resource createResource(org.eclipse.emf.common.util.URI uri)
          Creates an instance of the resource.
<T extends Element>
T
getASElement(MetaModelManager metaModelManager, java.lang.Class<T> pivotClass, org.eclipse.emf.ecore.EObject eObject)
          Return the OCL AS element corresponding to eObject using metaModelManager to supervise the correspondence and ensuring that the result is of asClass.
protected  org.eclipse.uml2.uml.Constraint getConstraintForEOperation(org.eclipse.emf.ecore.EOperation eOperation)
           
 org.eclipse.emf.ecore.EOperation getEOperation(ASResource asResource, org.eclipse.emf.ecore.EObject eObject)
          Return an EOperation for a pivot Operation if one is available.
 org.eclipse.emf.ecore.EReference getEReference(ASResource asResource, org.eclipse.emf.ecore.EObject eObject)
           
 int getHandlerPriority(org.eclipse.emf.ecore.EObject eObject)
          Return a positive handler priority if this factory can handle creation of an OCL AS type from the available object, negative if it cannot.
 int getHandlerPriority(org.eclipse.emf.ecore.resource.Resource resource)
          Return a positive handler priority if this factory can handle creation of an OCL AS resource from the available resource, negative if it cannot.
 int getHandlerPriority(org.eclipse.emf.common.util.URI uri)
          Return a positive handler priority if this factory can handle creation of an OCL AS resource from the available URI, negative if it cannot.
 java.lang.String getMetamodelNsURI(org.eclipse.emf.ecore.EPackage ePackage)
          Return a specific metamodel NsURI if ePackage has particular requirements as is the case for UML.
 org.eclipse.emf.common.util.URI getPackageURI(org.eclipse.emf.ecore.EObject eObject)
          Return the URI of an eObject if it can be treated as a Package.
 Element importFromResource(MetaModelManager metaModelManager, org.eclipse.emf.ecore.resource.Resource umlResource, org.eclipse.emf.common.util.URI uri)
          Return the root element in the Pivot resource resulting from import of the available resource.
 
Methods inherited from class org.eclipse.ocl.examples.pivot.resource.AbstractASResourceFactory
configureResource, createAS2MonikerVisitor, createAS2XMIidVisitor, createASSaverLocateVisitor, createASSaverNormalizeVisitor, createASSaverResolveVisitor, createPrettyPrintVisitor, createToStringVisitor, getContentType, installContentHandler, isCompatibleResource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE

@NonNull
public static final UMLASResourceFactory INSTANCE
Constructor Detail

UMLASResourceFactory

protected UMLASResourceFactory()
Method Detail

configure

public void configure(@NonNull
                      org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Description copied from interface: ASResourceFactory
Configure the MetaModelManager's external ResourceSet. Implementations may install any required extension or content to factory mappings in the resource factory registry.

Specified by:
configure in interface ASResourceFactory
Overrides:
configure in class AbstractASResourceFactory

createResource

@NonNull
public org.eclipse.emf.ecore.resource.Resource createResource(org.eclipse.emf.common.util.URI uri)
Description copied from class: AbstractASResourceFactory
Creates an instance of the resource.

Specified by:
createResource in interface org.eclipse.emf.ecore.resource.Resource.Factory
Overrides:
createResource in class AbstractASResourceFactory

getASElement

@Nullable
public <T extends Element> T getASElement(@NonNull
                                                   MetaModelManager metaModelManager,
                                                   @NonNull
                                                   java.lang.Class<T> pivotClass,
                                                   @NonNull
                                                   org.eclipse.emf.ecore.EObject eObject)
                               throws ParserException
Description copied from interface: ASResourceFactory
Return the OCL AS element corresponding to eObject using metaModelManager to supervise the correspondence and ensuring that the result is of asClass.

Specified by:
getASElement in interface ASResourceFactory
Overrides:
getASElement in class AbstractASResourceFactory
Throws:
ParserException

getConstraintForEOperation

protected org.eclipse.uml2.uml.Constraint getConstraintForEOperation(org.eclipse.emf.ecore.EOperation eOperation)

getEOperation

@Nullable
public org.eclipse.emf.ecore.EOperation getEOperation(@NonNull
                                                               ASResource asResource,
                                                               @NonNull
                                                               org.eclipse.emf.ecore.EObject eObject)
Description copied from interface: ASResourceFactory
Return an EOperation for a pivot Operation if one is available.
For UML this locates the corresponding operation in the Eclipse namespace for the OMG namespace.

Specified by:
getEOperation in interface ASResourceFactory
Overrides:
getEOperation in class AbstractASResourceFactory

getEReference

@Nullable
public org.eclipse.emf.ecore.EReference getEReference(@NonNull
                                                               ASResource asResource,
                                                               @NonNull
                                                               org.eclipse.emf.ecore.EObject eObject)
Specified by:
getEReference in interface ASResourceFactory
Overrides:
getEReference in class AbstractASResourceFactory

getHandlerPriority

public int getHandlerPriority(@NonNull
                              org.eclipse.emf.ecore.EObject eObject)
Description copied from interface: ASResourceFactory
Return a positive handler priority if this factory can handle creation of an OCL AS type from the available object, negative if it cannot. Generic handlers such as Ecore return a low priority.

Specified by:
getHandlerPriority in interface ASResourceFactory
Overrides:
getHandlerPriority in class AbstractASResourceFactory

getHandlerPriority

public int getHandlerPriority(@NonNull
                              org.eclipse.emf.ecore.resource.Resource resource)
Description copied from interface: ASResourceFactory
Return a positive handler priority if this factory can handle creation of an OCL AS resource from the available resource, negative if it cannot. Generic handlers such as Ecore return a low priority.

Specified by:
getHandlerPriority in interface ASResourceFactory
Overrides:
getHandlerPriority in class AbstractASResourceFactory

getHandlerPriority

public int getHandlerPriority(@NonNull
                              org.eclipse.emf.common.util.URI uri)
Description copied from interface: ASResourceFactory
Return a positive handler priority if this factory can handle creation of an OCL AS resource from the available URI, negative if it cannot. Generic handlers such as Ecore return a low priority.

Specified by:
getHandlerPriority in interface ASResourceFactory
Overrides:
getHandlerPriority in class AbstractASResourceFactory

getMetamodelNsURI

@Nullable
public java.lang.String getMetamodelNsURI(@NonNull
                                                   org.eclipse.emf.ecore.EPackage ePackage)
Description copied from interface: ASResourceFactory
Return a specific metamodel NsURI if ePackage has particular requirements as is the case for UML.

Specified by:
getMetamodelNsURI in interface ASResourceFactory
Overrides:
getMetamodelNsURI in class AbstractASResourceFactory

getPackageURI

@Nullable
public org.eclipse.emf.common.util.URI getPackageURI(@NonNull
                                                              org.eclipse.emf.ecore.EObject eObject)
Description copied from interface: ASResourceFactory
Return the URI of an eObject if it can be treated as a Package.

Specified by:
getPackageURI in interface ASResourceFactory
Overrides:
getPackageURI in class AbstractASResourceFactory

importFromResource

@Nullable
public Element importFromResource(@NonNull
                                           MetaModelManager metaModelManager,
                                           @NonNull
                                           org.eclipse.emf.ecore.resource.Resource umlResource,
                                           @Nullable
                                           org.eclipse.emf.common.util.URI uri)
                           throws ParserException
Description copied from interface: ASResourceFactory
Return the root element in the Pivot resource resulting from import of the available resource.

Specified by:
importFromResource in interface ASResourceFactory
Overrides:
importFromResource in class AbstractASResourceFactory
Throws:
ParserException