org.eclipse.ocl.examples.domain.utilities
Class StandaloneProjectMap.AbstractResourceLoadStatus

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.utilities.StandaloneProjectMap.AbstractResourceLoadStatus
All Implemented Interfaces:
org.eclipse.emf.common.notify.Adapter, StandaloneProjectMap.IResourceLoadStatus
Direct Known Subclasses:
StandaloneProjectMap.MultiplePackageResourceLoadStatus, StandaloneProjectMap.SinglePackageResourceLoadStatus
Enclosing class:
StandaloneProjectMap

public abstract static class StandaloneProjectMap.AbstractResourceLoadStatus
extends java.lang.Object
implements StandaloneProjectMap.IResourceLoadStatus, org.eclipse.emf.common.notify.Adapter


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
org.eclipse.emf.common.notify.Adapter.Internal
 
Field Summary
protected  StandaloneProjectMap.IConflictHandler conflictHandler
          The optional handler for namespace/platform or platform/namespace metamodel schizophrenia.
protected  org.eclipse.emf.ecore.resource.Resource eModel
          The dynamically loaded model (e.g.
protected  boolean generativeLoadInProgress
          Re-entrancy inhibitor for for generation from Pivot2Ecore.
protected  org.eclipse.emf.ecore.EPackage.Registry packageRegistry
           
protected  boolean recursiveLoadInProgress
          Re-entrancy detector for self-referential models such as Ecore.ecore.
protected  StandaloneProjectMap.IResourceDescriptor resourceDescriptor
           
protected  StandaloneProjectMap.IResourceLoadStrategy resourceLoadStrategy
          The strategy to be used to resolve further URI to EPackage mappings.
protected  org.eclipse.emf.ecore.resource.ResourceSet resourceSet
           
 
Constructor Summary
protected StandaloneProjectMap.AbstractResourceLoadStatus(StandaloneProjectMap.IResourceDescriptor resourceDescriptor, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
           
 
Method Summary
 void configureDelegatingResource()
          Configure the ResourceSet.URIResourceMap to resolve platform:/plugin and platform:/resource references to a pseudo resource that delegates to generated packages.
 void configureEPackageRegistry(org.eclipse.emf.ecore.resource.Resource resource)
          Configure the EPackage.Registry to resolve namesapce URI references to the specified resource.
 void configureResourceSetURIResourceMap(org.eclipse.emf.ecore.resource.Resource resource)
          Configure the ResourceSet.URIResourceMap to resolve platform:/plugin and platform:/resource references to the specified resource.
 void dispose()
          Dispose of all facilities used by the IResourceLoadStatus, and remove all EPackageDescriptor entries.
 org.eclipse.emf.ecore.EPackage getConflictingDynamicResource(org.eclipse.emf.ecore.EPackage ePackage)
          Return the EPackage to be used for a platform-resource/plugin URI after a namespace URI has already been loaded.
 org.eclipse.emf.ecore.EPackage getFirstEPackage()
          Return the first loaded EPackage which may be part of a model or a Java generated EPackageinstance..
 StandaloneProjectMap.IPackageLoadStatus getPackageLoadStatus(StandaloneProjectMap.IPackageDescriptor packageDescriptor)
          Return the package load status for the package identified by packageDescriptor
 org.eclipse.emf.ecore.EPackage.Registry getPackageRegistry()
          Return the package registry maintained by this resource load status
 org.eclipse.emf.ecore.resource.Resource getResource()
           
 StandaloneProjectMap.IResourceDescriptor getResourceDescriptor()
          Return the descriptor for the resource.
 StandaloneProjectMap.IResourceLoadStrategy getResourceLoadStrategy()
          Return the configured resource loading strategy.
 org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
          Return the ResourceSet to which the resource logically belongs.
 org.eclipse.emf.common.notify.Notifier getTarget()
           
 org.eclipse.emf.ecore.EPackage handleConflictingGeneratedPackage(StandaloneProjectMap.IPackageLoadStatus packageLoadStatus)
           
protected  void handleLoadException(org.eclipse.emf.ecore.resource.Resource resource, java.lang.String location, java.lang.Exception exception)
           
protected  void install()
           
 boolean isAdapterForType(java.lang.Object type)
           
 org.eclipse.emf.ecore.resource.Resource loadDynamicResource(org.eclipse.emf.common.util.URI nsURI)
          Load and return the EPackage appropriate to the platform resource or plugin resource using nsURI to identify a conflicting nsURI access,
 void loadGeneratedPackages()
          Load all the Java generated EPackage instances for the resource.
 void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
           
 void setConflictHandler(StandaloneProjectMap.IConflictHandler conflictHandler)
          Define a new conflict handler.
 void setGenerationInProgress(boolean isGenerating)
          Set true by Pivot2Ecore to inhibit auto-loading of newly added EPackages.
 void setResource(org.eclipse.emf.ecore.resource.Resource resource)
          Define the resource once it has been loaded.
 void setResourceLoadStrategy(StandaloneProjectMap.IResourceLoadStrategy resourceLoadStrategy)
          Define a new package load strategy.
 void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
           
 java.lang.String toString()
           
 void unloadedResource()
          Reset the status following notification that the model has been unloaded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

resourceDescriptor

@NonNull
protected final StandaloneProjectMap.IResourceDescriptor resourceDescriptor

resourceSet

@Nullable
protected org.eclipse.emf.ecore.resource.ResourceSet resourceSet

packageRegistry

@NonNull
protected final org.eclipse.emf.ecore.EPackage.Registry packageRegistry

conflictHandler

@Nullable
protected StandaloneProjectMap.IConflictHandler conflictHandler
The optional handler for namespace/platform or platform/namespace metamodel schizophrenia.


resourceLoadStrategy

@NonNull
protected StandaloneProjectMap.IResourceLoadStrategy resourceLoadStrategy
The strategy to be used to resolve further URI to EPackage mappings.


eModel

@Nullable
protected org.eclipse.emf.ecore.resource.Resource eModel
The dynamically loaded model (e.g. platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#/).


generativeLoadInProgress

protected boolean generativeLoadInProgress
Re-entrancy inhibitor for for generation from Pivot2Ecore.


recursiveLoadInProgress

protected boolean recursiveLoadInProgress
Re-entrancy detector for self-referential models such as Ecore.ecore.

Constructor Detail

StandaloneProjectMap.AbstractResourceLoadStatus

protected StandaloneProjectMap.AbstractResourceLoadStatus(@NonNull
                                                          StandaloneProjectMap.IResourceDescriptor resourceDescriptor,
                                                          @Nullable
                                                          org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Method Detail

configureEPackageRegistry

public void configureEPackageRegistry(@NonNull
                                      org.eclipse.emf.ecore.resource.Resource resource)
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Configure the EPackage.Registry to resolve namesapce URI references to the specified resource.

Specified by:
configureEPackageRegistry in interface StandaloneProjectMap.IResourceLoadStatus

configureDelegatingResource

public void configureDelegatingResource()
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Configure the ResourceSet.URIResourceMap to resolve platform:/plugin and platform:/resource references to a pseudo resource that delegates to generated packages.

Specified by:
configureDelegatingResource in interface StandaloneProjectMap.IResourceLoadStatus

configureResourceSetURIResourceMap

public void configureResourceSetURIResourceMap(@NonNull
                                               org.eclipse.emf.ecore.resource.Resource resource)
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Configure the ResourceSet.URIResourceMap to resolve platform:/plugin and platform:/resource references to the specified resource.

Specified by:
configureResourceSetURIResourceMap in interface StandaloneProjectMap.IResourceLoadStatus

dispose

public void dispose()
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Dispose of all facilities used by the IResourceLoadStatus, and remove all EPackageDescriptor entries.

Specified by:
dispose in interface StandaloneProjectMap.IResourceLoadStatus

getConflictingDynamicResource

@Nullable
public org.eclipse.emf.ecore.EPackage getConflictingDynamicResource(@NonNull
                                                                             org.eclipse.emf.ecore.EPackage ePackage)
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Return the EPackage to be used for a platform-resource/plugin URI after a namespace URI has already been loaded.

Specified by:
getConflictingDynamicResource in interface StandaloneProjectMap.IResourceLoadStatus

getFirstEPackage

@Nullable
public org.eclipse.emf.ecore.EPackage getFirstEPackage()
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Return the first loaded EPackage which may be part of a model or a Java generated EPackageinstance..

Specified by:
getFirstEPackage in interface StandaloneProjectMap.IResourceLoadStatus
Returns:

getPackageLoadStatus

@Nullable
public StandaloneProjectMap.IPackageLoadStatus getPackageLoadStatus(@NonNull
                                                                             StandaloneProjectMap.IPackageDescriptor packageDescriptor)
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Return the package load status for the package identified by packageDescriptor

Specified by:
getPackageLoadStatus in interface StandaloneProjectMap.IResourceLoadStatus

getResourceLoadStrategy

@NonNull
public StandaloneProjectMap.IResourceLoadStrategy getResourceLoadStrategy()
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Return the configured resource loading strategy.

Specified by:
getResourceLoadStrategy in interface StandaloneProjectMap.IResourceLoadStatus

getPackageRegistry

@NonNull
public org.eclipse.emf.ecore.EPackage.Registry getPackageRegistry()
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Return the package registry maintained by this resource load status

Specified by:
getPackageRegistry in interface StandaloneProjectMap.IResourceLoadStatus

getResourceDescriptor

@NonNull
public StandaloneProjectMap.IResourceDescriptor getResourceDescriptor()
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Return the descriptor for the resource.

Specified by:
getResourceDescriptor in interface StandaloneProjectMap.IResourceLoadStatus

getResource

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

getResourceSet

@Nullable
public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Return the ResourceSet to which the resource logically belongs. (Note that generated EPackage may have a null actual ResourceSet, but a non-null logical ResourceSet.)

Specified by:
getResourceSet in interface StandaloneProjectMap.IResourceLoadStatus

getTarget

@Nullable
public org.eclipse.emf.common.notify.Notifier getTarget()
Specified by:
getTarget in interface org.eclipse.emf.common.notify.Adapter

handleConflictingGeneratedPackage

@Nullable
public org.eclipse.emf.ecore.EPackage handleConflictingGeneratedPackage(@NonNull
                                                                                 StandaloneProjectMap.IPackageLoadStatus packageLoadStatus)

handleLoadException

protected void handleLoadException(org.eclipse.emf.ecore.resource.Resource resource,
                                   @NonNull
                                   java.lang.String location,
                                   java.lang.Exception exception)
                            throws java.lang.RuntimeException
Throws:
java.lang.RuntimeException

install

protected void install()

isAdapterForType

public boolean isAdapterForType(java.lang.Object type)
Specified by:
isAdapterForType in interface org.eclipse.emf.common.notify.Adapter

loadGeneratedPackages

public void loadGeneratedPackages()
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Load all the Java generated EPackage instances for the resource.

Specified by:
loadGeneratedPackages in interface StandaloneProjectMap.IResourceLoadStatus

loadDynamicResource

@Nullable
public org.eclipse.emf.ecore.resource.Resource loadDynamicResource(@NonNull
                                                                            org.eclipse.emf.common.util.URI nsURI)
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Load and return the EPackage appropriate to the platform resource or plugin resource using nsURI to identify a conflicting nsURI access,

Specified by:
loadDynamicResource in interface StandaloneProjectMap.IResourceLoadStatus

notifyChanged

public void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
Specified by:
notifyChanged in interface org.eclipse.emf.common.notify.Adapter

setConflictHandler

public void setConflictHandler(@Nullable
                               StandaloneProjectMap.IConflictHandler conflictHandler)
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Define a new conflict handler.

Specified by:
setConflictHandler in interface StandaloneProjectMap.IResourceLoadStatus

setGenerationInProgress

public void setGenerationInProgress(boolean isGenerating)
Set true by Pivot2Ecore to inhibit auto-loading of newly added EPackages.

Specified by:
setGenerationInProgress in interface StandaloneProjectMap.IResourceLoadStatus

setResource

public void setResource(@NonNull
                        org.eclipse.emf.ecore.resource.Resource resource)
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Define the resource once it has been loaded.

Specified by:
setResource in interface StandaloneProjectMap.IResourceLoadStatus

setResourceLoadStrategy

public void setResourceLoadStrategy(@NonNull
                                    StandaloneProjectMap.IResourceLoadStrategy resourceLoadStrategy)
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Define a new package load strategy.

Specified by:
setResourceLoadStrategy in interface StandaloneProjectMap.IResourceLoadStatus

setTarget

public void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
Specified by:
setTarget in interface org.eclipse.emf.common.notify.Adapter

toString

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

unloadedResource

public void unloadedResource()
Description copied from interface: StandaloneProjectMap.IResourceLoadStatus
Reset the status following notification that the model has been unloaded.

Specified by:
unloadedResource in interface StandaloneProjectMap.IResourceLoadStatus