Class ProfileApplicationRegistryImpl
- java.lang.Object
-
- org.modelversioning.emfprofile.application.registry.internal.ProfileApplicationRegistryImpl
-
- All Implemented Interfaces:
ProfileApplicationRegistry
public class ProfileApplicationRegistryImpl extends Object implements ProfileApplicationRegistry
-
-
Field Summary
Fields Modifier and Type Field Description static ProfileApplicationRegistryINSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyProfileToModel(String modelId, IFile profileApplicationsFile, Collection<Profile> profiles, ResourceSet resourceSet)To apply profiles on a modelProfileApplicationDecoratorgetProfileApplicationDecoratorOfContainedEObject(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.Collection<ProfileApplicationDecorator>getProfileApplications(String modelId)Returns profile application elements.booleanhasProfileApplications(String modelId)Checks if there are any profile applications defined on the given modelled resource.ProfileApplicationDecoratorloadProfileApplicationForModel(String modelId, IFile profileApplicationFile, ResourceSet resourceSet)Load profile application for model from a file.voidunloadAllProfileApplicationsForModel(String modelId)Unloads all profile applications for a model.voidunloadProfileApplicationForModel(String modelId, ProfileApplicationDecorator profileApplication)Unloads profile application for a model.
-
-
-
Field Detail
-
INSTANCE
public static final ProfileApplicationRegistry INSTANCE
-
-
Method Detail
-
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
public void unloadAllProfileApplicationsForModel(String modelId)
Description copied from interface:ProfileApplicationRegistryUnloads all profile applications for a model. Removes tracking of model id from registry.- Specified by:
unloadAllProfileApplicationsForModelin interfaceProfileApplicationRegistry
-
hasProfileApplications
public boolean hasProfileApplications(String modelId)
Description copied from interface:ProfileApplicationRegistryChecks if there are any profile applications defined on the given modelled resource.- Specified by:
hasProfileApplicationsin interfaceProfileApplicationRegistry- Returns:
-
getProfileApplications
public Collection<ProfileApplicationDecorator> getProfileApplications(String modelId)
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.
-
-