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
ModelResolver
getEcoreResource
in interface ModelResolver
java.lang.Exception
public FileHandle getHandle()
getHandle
in interface ModelResolver
protected org.eclipse.emf.ecore.EPackage[] getPackagesToRegister()
public ProjectRegistry getProjectRegistry()
ModelResolver
getProjectRegistry
in interface ModelResolver
public <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
ModelResolver
getResource
in interface ModelResolver
java.lang.Exception
public org.eclipse.emf.ecore.resource.Resource getResource(Registration<ModelNameAccessor> registration) throws java.io.IOException
java.io.IOException
public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
ModelResolver
getResourceSet
in interface ModelResolver
public <A extends Accessor<A>> org.eclipse.emf.common.util.URI getURI(A accessor)
ModelResolver
getURI
in interface ModelResolver
accessor
- the name and type of resource to be located.public org.eclipse.emf.common.util.URI getURI(java.lang.String modelName)
ModelResolver
getURI
in interface ModelResolver
modelName
- the name of the model to be located.public org.eclipse.emf.common.util.URI getURI(java.net.URI uri)
ModelResolver
getURI
in interface ModelResolver
uri
- 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