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

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.utilities.StandaloneProjectMap.PackageDescriptor
All Implemented Interfaces:
StandaloneProjectMap.IPackageDescriptor
Enclosing class:
StandaloneProjectMap

public static final class StandaloneProjectMap.PackageDescriptor
extends java.lang.Object
implements StandaloneProjectMap.IPackageDescriptor

PackageDescriptor supports lazy class loading and initialization of a compiled Ecore package. Class loading occurs in the context of the ProjectMap, which performs classpath scans, so it is assumed that everything is visible. Re-use in a larger context may require a new ProjectMap to be created. If a PackageDescriptor is installed under multiple URIs, the resource created by the first load is shared by all subsequent resolutions. If a PackageDescriptor is set to useModel, the *.ecore file is loaded to provide the EPackage, rather than the Java className. A PackageDescriptor maintains the declared context of a package which may be shared by many ResourceSets. In contrast a PackageStatus maintains the actual state of a package for a particular EPackage.Registry, each of which may have a distinct ResourceLoadStrategy and consequently may not load the same EPackage.


Field Summary
protected  java.lang.String className
          The Java class name of the compiled EPackage (e.g.
protected  org.eclipse.emf.common.util.URI namespaceURI
          The namespace URI of the EPackage (e.g.
protected  StandaloneProjectMap.IResourceDescriptor resourceDescriptor
          The MultiplePackageResourceDescriptor if this PackageDescriptor is part of a multi-package genmodel.
 
Constructor Summary
StandaloneProjectMap.PackageDescriptor(StandaloneProjectMap.IResourceDescriptor resourceDescriptor, org.eclipse.emf.common.util.URI nsURI, java.lang.String className)
           
 
Method Summary
 void configure(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, StandaloneProjectMap.IResourceLoadStrategy resourceLoadStrategy, StandaloneProjectMap.IConflictHandler conflictHandler)
          Configure the resourceSet-specific resource status of for this package to use a strategy and a conflictHandler.
 java.lang.String getClassName()
          Return the classname defined in the generated_packaged extension point, or null if undefined.
 org.eclipse.emf.ecore.EFactory getEFactory()
           
 org.eclipse.emf.common.util.URI getNsURI()
          Return the Package Namespace URI.
 java.util.List<? extends StandaloneProjectMap.IPackageDescriptor> getPackageDescriptors()
           
 StandaloneProjectMap.IResourceDescriptor getResourceDescriptor()
          Return the IResourceDescriptor containing this package.
 java.lang.String toString()
           
 
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
The MultiplePackageResourceDescriptor if this PackageDescriptor is part of a multi-package genmodel.


namespaceURI

@NonNull
protected final org.eclipse.emf.common.util.URI namespaceURI
The namespace URI of the EPackage (e.g. http://www.eclipse.org/emf/2002/Ecore).


className

@Nullable
protected final java.lang.String className
The Java class name of the compiled EPackage (e.g. org.eclipse.emf.ecore.EcorePackage).

Constructor Detail

StandaloneProjectMap.PackageDescriptor

public StandaloneProjectMap.PackageDescriptor(@NonNull
                                              StandaloneProjectMap.IResourceDescriptor resourceDescriptor,
                                              @NonNull
                                              org.eclipse.emf.common.util.URI nsURI,
                                              @Nullable
                                              java.lang.String className)
Method Detail

configure

public void configure(@Nullable
                      org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
                      @NonNull
                      StandaloneProjectMap.IResourceLoadStrategy resourceLoadStrategy,
                      @Nullable
                      StandaloneProjectMap.IConflictHandler conflictHandler)
Description copied from interface: StandaloneProjectMap.IPackageDescriptor
Configure the resourceSet-specific resource status of for this package to use a strategy and a conflictHandler.

Specified by:
configure in interface StandaloneProjectMap.IPackageDescriptor

getClassName

@Nullable
public java.lang.String getClassName()
Description copied from interface: StandaloneProjectMap.IPackageDescriptor
Return the classname defined in the generated_packaged extension point, or null if undefined.

Specified by:
getClassName in interface StandaloneProjectMap.IPackageDescriptor

getEFactory

@Nullable
public org.eclipse.emf.ecore.EFactory getEFactory()

getNsURI

@NonNull
public org.eclipse.emf.common.util.URI getNsURI()
Description copied from interface: StandaloneProjectMap.IPackageDescriptor
Return the Package Namespace URI.

Specified by:
getNsURI in interface StandaloneProjectMap.IPackageDescriptor

getPackageDescriptors

@NonNull
public java.util.List<? extends StandaloneProjectMap.IPackageDescriptor> getPackageDescriptors()

getResourceDescriptor

@NonNull
public StandaloneProjectMap.IResourceDescriptor getResourceDescriptor()
Description copied from interface: StandaloneProjectMap.IPackageDescriptor
Return the IResourceDescriptor containing this package.

Specified by:
getResourceDescriptor in interface StandaloneProjectMap.IPackageDescriptor

toString

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