public class AbstractModelResolver extends java.lang.Object implements ModelResolver
| Constructor and Description |
|---|
AbstractModelResolver(FileHandle handle) |
| Modifier and Type | Method and Description |
|---|---|
protected org.eclipse.emf.ecore.resource.ResourceSet |
createResourceSet()
Create the ResourceSet when one is required but undefined.
|
org.eclipse.emf.ecore.resource.Resource |
getEcoreResource(org.eclipse.emf.common.util.URI uri,
boolean loadOnDemand)
Return the Ecore Resource for uri optionally loading it if not already loaded.
|
FileHandle |
getHandle() |
protected org.eclipse.emf.ecore.EPackage[] |
getPackagesToRegister()
Return a list of packages to be registered for potential resolution against their URIs.
|
ProjectRegistry |
getProjectRegistry()
Return the project registry, creating and loading it if not already loaded.
|
<A extends Accessor<A>> |
getRegistration(A accessor) |
Registration<ModelNameAccessor> |
getRegistration(java.lang.String modelName) |
Registration<URIAccessor> |
getRegistration(java.net.URI uri) |
<A extends Accessor<A>> |
getRegistrations(Accessor.Namespace<A> namespace) |
org.eclipse.emf.ecore.resource.Resource |
getResource(Registration<ModelNameAccessor> registration) |
org.eclipse.emf.ecore.resource.Resource |
getResource(org.eclipse.emf.common.util.URI uri,
boolean loadOnDemand)
Return the EMF Resource for uri optionally loading it if not already loaded.
|
org.eclipse.emf.ecore.resource.ResourceSet |
getResourceSet()
Return the ResourceSet in which loaded resources are maintained.
|
<A extends Accessor<A>> |
getURI(A accessor)
Return the (Ecore) URI suitable for getting the (Ecore) resource defined by the
accessor in the context of a file defined by its handle.
|
org.eclipse.emf.common.util.URI |
getURI(java.lang.String modelName)
Return the (Ecore) URI suitable for getting the (Ecore) resource defined by the
modelName in the context of a file defined by its handle.
|
org.eclipse.emf.common.util.URI |
getURI(java.net.URI uri)
Return the (Ecore) URI suitable for getting the (Ecore) resource defined by the
(java.net.URI) uri in the context of a file defined by its handle.
|
protected void |
initialiseResourceFactoryRegistry(org.eclipse.emf.ecore.resource.Resource.Factory.Registry resourceFactoryRegistry)
Initialise the resourceFactoryRegistry of the resourceSet.
|
protected org.eclipse.emf.ecore.resource.ResourceSet |
initialiseResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Initialise the resourceSet.
|
void |
setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Define the
|
java.lang.String |
toString() |
public AbstractModelResolver(FileHandle handle)
protected org.eclipse.emf.ecore.resource.ResourceSet createResourceSet()
public org.eclipse.emf.ecore.resource.Resource getEcoreResource(org.eclipse.emf.common.util.URI uri,
boolean loadOnDemand)
throws java.lang.Exception
ModelResolvergetEcoreResource in interface ModelResolverjava.lang.Exceptionpublic FileHandle getHandle()
getHandle in interface ModelResolverprotected org.eclipse.emf.ecore.EPackage[] getPackagesToRegister()
public ProjectRegistry getProjectRegistry()
ModelResolvergetProjectRegistry in interface ModelResolverpublic <A extends Accessor<A>> Registration<A> getRegistration(A accessor)
public Registration<ModelNameAccessor> getRegistration(java.lang.String modelName)
public Registration<URIAccessor> getRegistration(java.net.URI uri)
public <A extends Accessor<A>> java.util.Collection<Registration<A>> getRegistrations(Accessor.Namespace<A> namespace)
public org.eclipse.emf.ecore.resource.Resource getResource(org.eclipse.emf.common.util.URI uri,
boolean loadOnDemand)
throws java.lang.Exception
ModelResolvergetResource in interface ModelResolverjava.lang.Exceptionpublic org.eclipse.emf.ecore.resource.Resource getResource(Registration<ModelNameAccessor> registration) throws java.io.IOException
java.io.IOExceptionpublic org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
ModelResolvergetResourceSet in interface ModelResolverpublic <A extends Accessor<A>> org.eclipse.emf.common.util.URI getURI(A accessor)
ModelResolvergetURI in interface ModelResolveraccessor - the name and type of resource to be located.public org.eclipse.emf.common.util.URI getURI(java.lang.String modelName)
ModelResolvergetURI in interface ModelResolvermodelName - the name of the model to be located.public org.eclipse.emf.common.util.URI getURI(java.net.URI uri)
ModelResolvergetURI in interface ModelResolveruri - the URI name of the model to be located.protected void initialiseResourceFactoryRegistry(org.eclipse.emf.ecore.resource.Resource.Factory.Registry resourceFactoryRegistry)
resourceFactoryRegistry - to be initialised.protected org.eclipse.emf.ecore.resource.ResourceSet initialiseResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
resourceSet - public void setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
resourceSet - public java.lang.String toString()
toString in class java.lang.Object