org.eclipse.gmt.umlx.registry.model
Class ProjectRegistry

java.lang.Object
  extended by org.eclipse.gmt.umlx.registry.model.ProjectRegistry

public class ProjectRegistry
extends java.lang.Object

A ProjectRegistry instance forms the root of a model registry. It provides the in-memory form of the org.eclipse.gmt.umlx.registry.modelregistry model read from and updated in the project .settings folder. The ProjectRegistry contains a FileHandleRegistry for each file handle for which models are registered. The FileHandleRegistry in turn contains an AccessorRegistry for each Accessor class and the AccessorRegistry contains the model Registrations.


Field Summary
static java.lang.String DEFAULT_SERIALISATION_NAME
           
 
Constructor Summary
ProjectRegistry(AbstractProjectHandle projectHandle, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
           
 
Method Summary
 FileHandleRegistry add(AbstractFileHandle fileHandle)
           
<A extends Accessor>
Registration<A>
add(Registration<A> registration)
           
 FileHandleRegistry get(AbstractFileHandle fileHandle)
           
 FileHandleRegistry getOrCreate(AbstractFileHandle fileHandle)
           
 AbstractProjectHandle getProject()
           
<A extends Accessor>
Registration<A>
getRegistration(AbstractFileHandle fileHandle, A accessor)
          Return the registration applicable to accessor in the context of fileHandle
<A extends Accessor>
java.util.Collection<Registration<A>>
getRegistrations(AbstractFileHandle fileHandle, java.lang.Class<A> accessorClass)
          Return all registrations applicable to accessorClass in the context of fileHandle, typically to treat all such registrations as a look-up path.
 org.eclipse.emf.common.util.URI getResolvedURI(AbstractFileHandle fileHandle, Accessor accessor)
          Return the URI that resolves accessor within the context of fileHandle after resolution against the URI of the project.
 org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
           
 org.eclipse.emf.common.util.URI getURI(AbstractFileHandle fileHandle, Accessor accessor)
          Return the URI that resolves accessor within the context of fileHandle.
 boolean loadModel()
           
<A extends Accessor>
Registration<A>
remove(Registration<A> registration)
           
 org.eclipse.emf.common.util.URI resolveURI(org.eclipse.emf.common.util.URI uri)
          Return the URI after resolution against the project file handle URI.
 boolean saveModel()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_SERIALISATION_NAME

public static final java.lang.String DEFAULT_SERIALISATION_NAME
See Also:
Constant Field Values
Constructor Detail

ProjectRegistry

public ProjectRegistry(AbstractProjectHandle projectHandle,
                       org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Method Detail

add

public FileHandleRegistry add(AbstractFileHandle fileHandle)

add

public <A extends Accessor> Registration<A> add(Registration<A> registration)

get

public FileHandleRegistry get(AbstractFileHandle fileHandle)

getOrCreate

public FileHandleRegistry getOrCreate(AbstractFileHandle fileHandle)

getProject

public AbstractProjectHandle getProject()

getRegistration

public <A extends Accessor> Registration<A> getRegistration(AbstractFileHandle fileHandle,
                                                            A accessor)
Return the registration applicable to accessor in the context of fileHandle

Type Parameters:
A - kind of accessor
Parameters:
fileHandle - defining look-up context
accessor - name of accessor
Returns:
the registration

getRegistrations

public <A extends Accessor> java.util.Collection<Registration<A>> getRegistrations(AbstractFileHandle fileHandle,
                                                                                   java.lang.Class<A> accessorClass)
Return all registrations applicable to accessorClass in the context of fileHandle, typically to treat all such registrations as a look-up path.

Parameters:
Class - kind of accessor
fileHandle - defining look-up context
accessor - name of accessor
Returns:
the registrations

getResolvedURI

public org.eclipse.emf.common.util.URI getResolvedURI(AbstractFileHandle fileHandle,
                                                      Accessor accessor)
Return the URI that resolves accessor within the context of fileHandle after resolution against the URI of the project.

Parameters:
fileHandle - defining look-up context
accessor - name and kind of accessor
Returns:
the resolved URI

getResourceSet

public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()

getURI

public org.eclipse.emf.common.util.URI getURI(AbstractFileHandle fileHandle,
                                              Accessor accessor)
Return the URI that resolves accessor within the context of fileHandle.

Parameters:
fileHandle - defining look-up context
accessor - name and kind of accessor
Returns:
the URI

loadModel

public boolean loadModel()

remove

public <A extends Accessor> Registration<A> remove(Registration<A> registration)

resolveURI

public org.eclipse.emf.common.util.URI resolveURI(org.eclipse.emf.common.util.URI uri)
Return the URI after resolution against the project file handle URI.

Parameters:
uri - uri to resolve
Returns:
the resolved URI

saveModel

public boolean saveModel()

toString

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