Class ProfileApplicationRegistryImpl
java.lang.Object
org.modelversioning.emfprofile.application.registry.internal.ProfileApplicationRegistryImpl
- All Implemented Interfaces:
ProfileApplicationRegistry
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyProfileToModel(String modelId, IFile profileApplicationsFile, Collection<Profile> profiles, ResourceSet resourceSet) To apply profiles on a modelgetProfileApplicationDecoratorOfContainedEObject(String modelId, EObject eObject) Gets the instance of the @linkProfileApplicationDecoratorthat is a parent of the providedEObjectand it searches amongst all profile application decorators for the given model id.getProfileApplications(String modelId) Returns profile application elements.booleanhasProfileApplications(String modelId) Checks if there are any profile applications defined on the given modelled resource.loadProfileApplicationForModel(String modelId, IFile profileApplicationFile, ResourceSet resourceSet) Load profile application for model from a file.voidUnloads all profile applications for a model.voidunloadProfileApplicationForModel(String modelId, ProfileApplicationDecorator profileApplication) Unloads profile application for a model.
-
Field Details
-
INSTANCE
-
-
Method Details
-
applyProfileToModel
public void applyProfileToModel(String modelId, IFile profileApplicationsFile, Collection<Profile> profiles, ResourceSet resourceSet) throws Exception Description copied from interface:ProfileApplicationRegistryTo apply profiles on a model- Specified by:
applyProfileToModelin interfaceProfileApplicationRegistry- Parameters:
modelId- Generated Id of the opened model's resource in user interface editor.profileApplicationsFile- file where profile applications are saved.profiles- collection of profiles that are going to be applied on a model resource.resourceSet- is optional. If it's not provided, the registry's default resource set will be used instead.- Throws:
Exception
-
loadProfileApplicationForModel
public ProfileApplicationDecorator loadProfileApplicationForModel(String modelId, IFile profileApplicationFile, ResourceSet resourceSet) throws Exception Description copied from interface:ProfileApplicationRegistryLoad profile application for model from a file. Returnsfalseif this profile application was already loaded.- Specified by:
loadProfileApplicationForModelin interfaceProfileApplicationRegistryresourceSet- is optional. If it's not provided, the registry's default resource set will be used instead.- Returns:
nullif already loaded, otherwise the loaded profile application.- Throws:
Exception
-
unloadProfileApplicationForModel
public void unloadProfileApplicationForModel(String modelId, ProfileApplicationDecorator profileApplication) Description copied from interface:ProfileApplicationRegistryUnloads profile application for a model.- Specified by:
unloadProfileApplicationForModelin interfaceProfileApplicationRegistry
-
unloadAllProfileApplicationsForModel
Description copied from interface:ProfileApplicationRegistryUnloads all profile applications for a model. Removes tracking of model id from registry.- Specified by:
unloadAllProfileApplicationsForModelin interfaceProfileApplicationRegistry
-
hasProfileApplications
Description copied from interface:ProfileApplicationRegistryChecks if there are any profile applications defined on the given modelled resource.- Specified by:
hasProfileApplicationsin interfaceProfileApplicationRegistry- Returns:
-
getProfileApplications
Description copied from interface:ProfileApplicationRegistryReturns profile application elements.- Specified by:
getProfileApplicationsin interfaceProfileApplicationRegistry- Returns:
-
getProfileApplicationDecoratorOfContainedEObject
public ProfileApplicationDecorator getProfileApplicationDecoratorOfContainedEObject(String modelId, EObject eObject) Description copied from interface:ProfileApplicationRegistryGets the instance of the @linkProfileApplicationDecoratorthat is a parent of the providedEObjectand it searches amongst all profile application decorators for the given model id.- Specified by:
getProfileApplicationDecoratorOfContainedEObjectin interfaceProfileApplicationRegistry- Parameters:
modelId- The string identification of the modelled resource.eObject- in question- Returns:
ProfileApplicationDecoratorif everything OK,nullif could not find it or any of the parents was alsonullwhich would indicate that the eObject was removed together with parent.
-