public interface EMFRepository
extends java.lang.AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROP_BASE_URI |
static java.lang.String |
PROP_CONTENT_TYPE |
static java.lang.String |
PROP_DEFAULT_LOAD_OPTIONS |
static java.lang.String |
PROP_ID |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanResource(Resource allTlcResource)
In EMF data are cached.
|
<T extends EObject> |
createProxy(EClass eClass,
java.lang.String id)
Returns the
EObject tha is a proxy of the given EClass and with the given id |
Resource |
createResource(EObject object)
Creates a resource for a given
EObject. |
Resource |
createResource(EObject object,
java.lang.String contentType)
Creates a resource for a given
EObject. |
ResourceSet |
createResourceSet()
Creates a new
ResourceSet out side the repository |
URI |
createUri(EObject object)
Creates the
URI from a given EObject |
void |
delete(EObject object)
Deletes an object
|
EObject |
detach(EObject object)
Detaches an object from the resource
|
void |
dispose()
Cleans up all resources
|
java.lang.Object |
getAdapter(java.lang.Class<?> adapter)
An adapter method to adapt the repository for e.g.
|
<T extends EObject> |
getAllEObjects(EClass eClass)
Returns a list of all
EObject of the given EClass or an empty List |
<T extends EObject> |
getAllEObjects(EClass eClass,
java.util.Map<?,?> options)
Returns a list of all
EObject of the given EClass or an empty List |
java.lang.String |
getBaseUri()
Returns the base uri
|
<T extends EObject> |
getEObject(EClass eClass,
java.lang.Object id)
Returns the
EObject of the given EClass and id or null |
<T extends EObject> |
getEObject(EClass eClass,
java.lang.Object id,
java.util.Map<?,?> options)
Returns the
EObject of the given EClass and id or null |
<T extends EObject> |
getEObject(java.lang.String eClassName,
java.lang.Object id)
Returns the
EObject of the given EClass name and id or null |
<T extends EObject> |
getEObject(java.lang.String eClassName,
java.lang.Object id,
java.util.Map<?,?> options)
Returns the
EObject of the given EClass name and id or null |
<T extends EObject> |
getEObject(URI uri)
Returns the
EObject for a given URI or null |
<T extends EObject> |
getEObject(URI uri,
java.util.Map<?,?> options)
Returns the
EObject for a given URI or null |
java.lang.String |
getId()
Returns the id of the resource provider
|
Resource |
getResource(URI createURI,
boolean b)
Gets a resource for the given
URI and loads it on demand, if the parameter is set to true |
ResourceSet |
getResourceSet()
Gets the repository owned
ResourceSet |
boolean |
isDisposed()
Returns
true, if the repository was already disposed |
void |
reload(EObject object)
Reloads an object
|
void |
save(java.util.Collection<EObject> objects)
Saves the given objects
|
void |
save(java.util.Collection<EObject> object,
java.util.Map<?,?> options)
Saves the given objects
|
void |
save(EObject... objects)
Saves the given objects
|
void |
save(EObject object)
Saves the given object
|
void |
save(EObject object,
java.util.Map<?,?> options)
Saves the given object
|
void |
save(EObject object,
java.lang.String contentType)
Saves the given object
|
void |
save(EObject object,
java.lang.String contentType,
java.util.Map<?,?> options)
Saves the given object
|
void |
save(EObject object,
URI uri)
Saves the given object at the given uri
|
void |
save(EObject object,
URI uri,
java.util.Map<?,?> options)
Saves the given object at the given uri
|
void |
save(java.util.Map<?,?> options,
EObject... objects)
Saves the given objects
|
static final java.lang.String PROP_ID
static final java.lang.String PROP_BASE_URI
static final java.lang.String PROP_CONTENT_TYPE
static final java.lang.String PROP_DEFAULT_LOAD_OPTIONS
java.lang.String getId()
ResourceSet getResourceSet()
ResourceSetResourceSetResourceSet createResourceSet()
ResourceSet out side the repositoryResourceSetResource getResource(URI createURI,
boolean b)
URI and loads it on demand, if the parameter is set to trueuri - the URI to create a resource fromloadOnDemand - set to true if the resource should be loadedResource or nullvoid cleanResource(Resource allTlcResource)
resource - the resource to be cleanedResource createResource(EObject object,
java.lang.String contentType)
EObject. If the object already has a resource,
this will returned. Otherwise a new resource will be created and the object will be attached to the resourceobject - the EObject to create the resource fromcontentType - the content type of the object (find it in the package interface)Resource createResource(EObject object)
EObject. If the object already has a resource,
this will returned. Otherwise a new resource will be created and the object will be attached to the resourceobject - the EObject to create the resource fromjava.lang.String getBaseUri()
<T extends EObject> T createProxy(EClass eClass,
java.lang.String id)
EObject tha is a proxy of the given EClass and with the given ideClass - the EClass to create the proxy forid - the id of the ObjectEObject as a proxy<T extends EObject> T getEObject(URI uri)
EObject for a given URI or nulluri - the object uriEObject instance or null<T extends EObject> T getEObject(URI uri,
java.util.Map<?,?> options)
EObject for a given URI or nulluri - the object urioptions - the load optionsEObject instance or null<T extends EObject> T getEObject(java.lang.String eClassName,
java.lang.Object id)
EObject of the given EClass name and id or nulleClassName - the String name of the EObjectid - the primary key of the objectEObject of the given EClass name and id or null<T extends EObject> T getEObject(java.lang.String eClassName,
java.lang.Object id,
java.util.Map<?,?> options)
EObject of the given EClass name and id or nulleClassName - the String name of the EObjectid - the primary key of the objectoptions - the load optionsEObject of the given EClass name and id or nullURI createUri(EObject object)
URI from a given EObjectobject - the EObject to create the URI fromURI or null on errorsvoid reload(EObject object)
object - the EObject to reloadvoid delete(EObject object)
object - the EObject to reloadvoid save(EObject object,
java.lang.String contentType)
object - the object to savecontentType - the corresponding content type of the modelvoid save(EObject object,
java.lang.String contentType,
java.util.Map<?,?> options)
object - the object to savecontentType - the corresponding content type of the modeloptions - the save optionsvoid save(EObject object)
object - the object to savevoid save(EObject object,
java.util.Map<?,?> options)
object - the object to saveoptions - the save optionsvoid save(EObject object,
URI uri)
object - the object to saveuri - the uri of the storage locationvoid save(EObject object,
URI uri,
java.util.Map<?,?> options)
object - the object to saveuri - the uri of the storage locationoptions - the save optionsvoid save(java.util.Collection<EObject> object,
java.util.Map<?,?> options)
object - the object to saveoptions - the save optionsvoid save(java.util.Map<?,?> options,
EObject... objects)
objects - the object to saveoptions - the save optionsvoid save(java.util.Collection<EObject> objects)
objects - the object to saveoptions - the save optionsvoid save(EObject... objects)
object - the object to saveoptions - the save optionsEObject detach(EObject object)
object - the object to detachEObject<T extends EObject> T getEObject(EClass eClass,
java.lang.Object id)
EObject of the given EClass and id or nulleClass - the EClass of the EObjectid - the primary key of the objectEObject of the given EClass name and id or null<T extends EObject> T getEObject(EClass eClass,
java.lang.Object id,
java.util.Map<?,?> options)
EObject of the given EClass and id or nulleClass - the EClass of the EObjectid - the primary key of the objectoptions - the load optionsEObject of the given EClass name and id or null<T extends EObject> java.util.List<T> getAllEObjects(EClass eClass)
EObject of the given EClass or an empty ListeClass - the EClass of the objects to returnList<T extends EObject> java.util.List<T> getAllEObjects(EClass eClass,
java.util.Map<?,?> options)
EObject of the given EClass or an empty ListeClass - the EClass of the objects to returnoptions - the load optionsListEMFRepositoryException - thrown when an error during getting all objects occurboolean isDisposed()
true, if the repository was already disposedvoid dispose()
java.lang.Object getAdapter(java.lang.Class<?> adapter)
adapter - the type to adapt tonullData In Motion Consulting