org.eclipse.ocl.examples.pivot.resource
Interface ASResourceFactory

All Superinterfaces:
org.eclipse.emf.ecore.resource.Resource.Factory
All Known Implementing Classes:
AbstractASResourceFactory, CompleteOCLASResourceFactory, EcoreASResourceFactory, EssentialOCLASResourceFactory, OCLASResourceFactory, OCLinEcoreASResourceFactory, OCLstdlibASResourceFactory, UMLASResourceFactory

public interface ASResourceFactory
extends org.eclipse.emf.ecore.resource.Resource.Factory

ASResourceFactory provides Resource-type-dependent functionality for an OCL Abstract Syntax (Pivot) Model without requiring a corresponding Resource to exist. It is therefore typically used to create ASResource-related artefacts.


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 int CAN_HANDLE
           
static int CANNOT_HANDLE
           
static int MAY_HANDLE
           
 
Method Summary
 void configure(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
          Configure the MetaModelManager's external ResourceSet.
 AS2MonikerVisitor createAS2MonikerVisitor(AS2Moniker as2moniker)
          Create a visitor to compute a structural descriptor for an element.
 AS2XMIidVisitor createAS2XMIidVisitor(AS2XMIid as2id)
          Create a visitor to compute the xmi:id value of an element.
 ASSaverLocateVisitor createASSaverLocateVisitor(ASSaver asSaver)
          Create a visitor to locate orphan specializations.
 ASSaverNormalizeVisitor createASSaverNormalizeVisitor(ASSaver asSaver)
          Create a visitor to normalize content.
 ASSaverResolveVisitor createASSaverResolveVisitor(ASSaver asSaver)
          Create a visitor to resolve orphan specializations.
 PrettyPrintVisitor createPrettyPrintVisitor(PrettyPrinter prettyPrinter)
          Create a visitor to provide a pretty printed representation of one or more elements in the resource.
 ToStringVisitor createToStringVisitor(java.lang.StringBuilder s)
          Create a visitor to provide a debug representation of one or more elements in the resource.
<T extends Element>
T
getASElement(MetaModelManager metaModelManager, java.lang.Class<T> asClass, 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.
 java.lang.String getContentType()
          Return the Content Type Identifier supported by this ASResourceFactory.
 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 resource, org.eclipse.emf.common.util.URI uri)
          Return the root element in the Pivot resource resulting from import of the available resource.
 boolean isCompatibleResource(org.eclipse.emf.ecore.resource.Resource newResource, org.eclipse.emf.ecore.resource.Resource oldResource)
          Return true if newResource can be ignored in favour of an already loaded oldResource.
 
Methods inherited from interface org.eclipse.emf.ecore.resource.Resource.Factory
createResource
 

Field Detail

CANNOT_HANDLE

static final int CANNOT_HANDLE
See Also:
Constant Field Values

MAY_HANDLE

static final int MAY_HANDLE
See Also:
Constant Field Values

CAN_HANDLE

static final int CAN_HANDLE
See Also:
Constant Field Values
Method Detail

configure

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

Parameters:
resourceSet -

createAS2MonikerVisitor

@NonNull
AS2MonikerVisitor createAS2MonikerVisitor(@NonNull
                                                  AS2Moniker as2moniker)
Create a visitor to compute a structural descriptor for an element.


createAS2XMIidVisitor

@NonNull
AS2XMIidVisitor createAS2XMIidVisitor(@NonNull
                                              AS2XMIid as2id)
Create a visitor to compute the xmi:id value of an element.


createASSaverLocateVisitor

@NonNull
ASSaverLocateVisitor createASSaverLocateVisitor(@NonNull
                                                        ASSaver asSaver)
Create a visitor to locate orphan specializations.


createASSaverNormalizeVisitor

@NonNull
ASSaverNormalizeVisitor createASSaverNormalizeVisitor(@NonNull
                                                              ASSaver asSaver)
Create a visitor to normalize content.


createASSaverResolveVisitor

@NonNull
ASSaverResolveVisitor createASSaverResolveVisitor(@NonNull
                                                          ASSaver asSaver)
Create a visitor to resolve orphan specializations.


createPrettyPrintVisitor

@NonNull
PrettyPrintVisitor createPrettyPrintVisitor(@NonNull
                                                    PrettyPrinter prettyPrinter)
Create a visitor to provide a pretty printed representation of one or more elements in the resource.


createToStringVisitor

@NonNull
ToStringVisitor createToStringVisitor(@NonNull
                                              java.lang.StringBuilder s)
Create a visitor to provide a debug representation of one or more elements in the resource.


getASElement

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

Throws:
ParserException

getContentType

@NonNull
java.lang.String getContentType()
Return the Content Type Identifier supported by this ASResourceFactory.


getEOperation

@Nullable
org.eclipse.emf.ecore.EOperation getEOperation(@NonNull
                                                        ASResource asResource,
                                                        @NonNull
                                                        org.eclipse.emf.ecore.EObject eObject)
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.

Parameters:
asResource -

getEReference

@Nullable
org.eclipse.emf.ecore.EReference getEReference(@NonNull
                                                        ASResource asResource,
                                                        @NonNull
                                                        org.eclipse.emf.ecore.EObject eObject)

getHandlerPriority

int getHandlerPriority(@NonNull
                       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. Generic handlers such as Ecore return a low priority.


getHandlerPriority

int getHandlerPriority(@NonNull
                       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. Generic handlers such as Ecore return a low priority.


getHandlerPriority

int getHandlerPriority(@NonNull
                       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. Generic handlers such as Ecore return a low priority.


getMetamodelNsURI

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


getPackageURI

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


importFromResource

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

Throws:
ParserException

isCompatibleResource

boolean isCompatibleResource(@NonNull
                             org.eclipse.emf.ecore.resource.Resource newResource,
                             @NonNull
                             org.eclipse.emf.ecore.resource.Resource oldResource)
Return true if newResource can be ignored in favour of an already loaded oldResource. Return false if an error message is required