Interface IProfileFacade
- All Known Implementing Classes:
ProfileFacadeImpl
StereotypeApplications.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EMFProfileApplicationFactoryTheEMFProfileApplicationPackageinstance.static final EMFProfileApplicationPackageTheEMFProfileApplicationPackageinstance.static final EMFProfileFactoryTheEMFProfileFactoryinstancestatic final EMFProfilePackageTheEMFProfilePackageinstance.static final EClassTheProfileApplicationEClass.static final EReferenceTheEReferenceused to apply stereotypes.static final EClass -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNestedEObject(EObject container, EReference eReference, EObject eObject) Adds an instance of nested object to the reference of the container.apply(Stereotype stereotype, EObject eObject) Applies the specifiedstereotypeto the specifiedeObject.apply(Stereotype stereotype, EObject eObject, Extension extension) Applies the specifiedstereotypeto the specifiedeObjectusing the specifiedextension.apply(StereotypeApplicability stereotypeApplicability, EObject eObject) Applies the specifiedapplicableStereotype.findOrCreateProfileApplication(Profile profile) Finds or creates a profile application for the specifiedprofile.getApplicableStereotypes(EClass eClass) Returns the list of applicable stereotype for the specified type ineClass.getApplicableStereotypes(EObject eObject) Returns the list of applicable stereotype for the specifiedeObject.getAppliedStereotypes(EObject eObject) Returns all stereotypes currently applied to the specifiedeObject(list ofStereotypeApplications).Returns the list of currently loadedProfiles.When loading profile application resource, this method is used to get a reference toProfileApplicationReturns allStereotypeApplicationshandled by this facade.getStereotypeFeatures(Stereotype stereotype) Returns the list ofEStructuralFeatures that can be set for the specifiedstereotype.getTaggedValue(EObject stereotypeApplication, EStructuralFeature taggedValue) Returns the value of the giventaggedValueof the givenstereotypeApplication.booleanisApplicable(Stereotype stereotype, EObject eObject) Specifies whether thestereotypeis applicable toeObject.booleanisApplicable(Stereotype stereotype, EObject eObject, Extension extension) Specifies whether thestereotypeis applicable toeObjectusing the specifiedextension.voidloadProfile(Profile profile) Loads the specifiedprofile.voidloadProfiles(EList<Profile> profiles) Loads the specifiedprofiles.voidloadProfiles(Resource resource) Loads allProfiles contained by the specifiedresource.voidmakeApplicable(Profile profile) Turns the specifiedprofileinto an applicable profile.voidremoveEObject(EObject eObject) Removes the specifiedEObjectfrom managedProfileApplicationvoidremoveStereotypeApplication(StereotypeApplication stereotypeApplication) Removes the specifiedStereotypeApplication.voidsave()Saves the currently set profile application resource.voidsetProfileApplicationFileAndInitializeResource(IFile profileApplicationFile, ResourceSet resourceSet) Sets theIFilecontaining the profile application and initializes a resource.voidsetProfileApplicationResource(Resource resource) Sets theResourcecontaining the profile application.voidsetTaggedValue(EObject stereotypeApplication, EStructuralFeature taggedValue, Object newValue) Sets the value of the giventaggedValueof thestereotypeApplicationto the new value.voidunload()Unloads this facade.voidunloadProfile(Profile profile) Unloads the specifiedprofile.validateAll(EObject currentlySelectedEObject) Validates the entire profile application.
-
Field Details
-
EMF_PROFILE_PACKAGE
TheEMFProfilePackageinstance. -
EMF_PROFILE_FACTORY
TheEMFProfileFactoryinstance -
EMF_PROFILE_APPLICATION_FACTORY
TheEMFProfileApplicationPackageinstance. -
EMF_PROFILE_APPLICATION_PACKAGE
TheEMFProfileApplicationPackageinstance. -
PROFILE_APPLICATION_ECLASS
TheProfileApplicationEClass. -
STEREOTYPE_APPLICATION_ECLASS
-
STEREOTYPE_APPLICATION_APPLIED_TO_REFERENCE
TheEReferenceused to apply stereotypes.
-
-
Method Details
-
makeApplicable
Turns the specified
profileinto an applicable profile.This method can be called without being initialized by loading a
Profileof an application.- Parameters:
profile- to turn into an applicable profile.
-
loadProfile
Loads the specifiedprofile.- Parameters:
profile- theProfileto load.
-
unloadProfile
Unloads the specifiedprofile.- Parameters:
profile- theProfileto unload.
-
loadProfiles
Loads allProfiles contained by the specifiedresource.- Parameters:
resource- containing the profiles to be loaded.
-
loadProfiles
Loads the specifiedprofiles.- Parameters:
profiles- theProfiles to be loaded.
-
getLoadedProfiles
Returns the list of currently loadedProfiles.- Returns:
- the list of currently loaded
Profiles.
-
setProfileApplicationFileAndInitializeResource
void setProfileApplicationFileAndInitializeResource(IFile profileApplicationFile, ResourceSet resourceSet) throws IOException Sets theIFilecontaining the profile application and initializes a resource.- Parameters:
profileApplicationFile-- Throws:
IOException- if loading to resource fails.
-
getApplicableStereotypes
Returns the list of applicable stereotype for the specified type ineClass.- Parameters:
eClass- to get applicable stereotype for.- Returns:
- the list of applicable
Stereotypes.
-
getApplicableStereotypes
Returns the list of applicable stereotype for the specifiedeObject.- Parameters:
eObject- to get applicable stereotype for.- Returns:
- the list of applicable
Stereotypes.
-
apply
Applies the specifiedstereotypeto the specifiedeObject.This method creates a new instance of the specified
Stereotypeand adds it to the currently set profile application resource (cf.#setProfileApplicationResourceAndFile(Resource)). If no resource is currently set, this method throws anIllegalStateException.- Parameters:
stereotype- to apply.eObject- to apply thestereotypeto.- Returns:
- the created instance of the
Stereotype.
-
apply
Applies the specifiedstereotypeto the specifiedeObjectusing the specifiedextension.This method creates a new instance of the specified
Stereotypeand adds it to the currently set profile application resource (cf.#setProfileApplicationResourceAndFile(Resource)). If no resource is currently set, this method throws anIllegalStateException.- Parameters:
stereotype- to apply.eObject- to apply thestereotypeto.extension- the extension to be used for applying the stereotype.- Returns:
- the created instance of the
Stereotype.
-
apply
Applies the specifiedapplicableStereotype.This method is a convenience method for
apply(Stereotype, EObject, Extension).- Parameters:
stereotypeApplicability- the applicable stereotype to be applied.eObject- to apply theapplicableStereotypeto.- Returns:
- the created instance of the
Stereotype.
-
getStereotypeApplications
EList<StereotypeApplication> getStereotypeApplications()Returns allStereotypeApplicationshandled by this facade.- Returns:
- all
StereotypeApplications
-
getAppliedStereotypes
Returns all stereotypes currently applied to the specifiedeObject(list ofStereotypeApplications).- Parameters:
eObject- to get applied stereotypes for.- Returns:
- the list of
StereotypeApplications.
-
isApplicable
Specifies whether thestereotypeis applicable toeObject.- Parameters:
stereotype- to check.eObject- to check.- Returns:
trueif applicable, otherwisefalse.
-
isApplicable
Specifies whether thestereotypeis applicable toeObjectusing the specifiedextension.- Parameters:
stereotype- to check.eObject- to check.extension- the extension to check.- Returns:
trueif applicable, otherwisefalse.
-
getStereotypeFeatures
Returns the list ofEStructuralFeatures that can be set for the specifiedstereotype.- Parameters:
stereotype- to getEStructuralFeatures for.- Returns:
- the list of settable
EStructuralFeatures.
-
getTaggedValue
Returns the value of the giventaggedValueof the givenstereotypeApplication.If the tagged value is
many-valued, the result will be anEListand each object in the list will bean instance ofthe feature'stype; the list's contents are not affected byresolveargument. Otherwise the result directly will be an instance of the feature's type; if it is aproxy, it is resolved.- Parameters:
stereotypeApplication- to get feature value for.taggedValue- the tagged value to fetch.- Returns:
- the value of the given tagged value of the object.
-
setTaggedValue
Sets the value of the giventaggedValueof thestereotypeApplicationto the new value.If the feature is
many-valued, the new value must be anEListand each object in that list must bean instance ofthe feature'stype; the existing contents are cleared and the contents of the new value are added. However, if the new value is the content list itself, or is modified as a side effect of modifying the content list (i.e., if it is a view on the content list), the behavior is undefined and will likely result in simply clearing the list. If the feature is single-valued, the new value directly must be an instance of the feature's type and it becomes the new value of the feature of the object. If the feature isunsettable, the modeled state becomes set; otherwise, the feature may still not consideredsetif the new value is the same as the default.- Parameters:
stereotypeApplication- to set feature value.taggedValue- the tagged value to set.newValue- the value to set.- Throws:
IllegalArgumentException- if the feature is not one themeta class'sfeatures, or it isn'tchangeable.ClassCastException- if there is a type conflict.ArrayStoreException- if there is a type conflict.
-
save
Saves the currently set profile application resource.- Throws:
IOException- if writing to file fails.
-
unload
void unload()Unloads this facade. -
removeStereotypeApplication
Removes the specifiedStereotypeApplication.- Parameters:
stereotypeApplication- stereotype application to remove.
-
validateAll
Validates the entire profile application.- Parameters:
currentlySelectedEObject- currently selected object. This is used for obtaining the annotated model in case no stereotype application has been created yet.- Returns:
- the validation result.
-
getProfileApplicationResource
Resource getProfileApplicationResource() -
getProfileApplications
EList<ProfileApplication> getProfileApplications()When loading profile application resource, this method is used to get a reference toProfileApplication- Returns:
-
findOrCreateProfileApplication
Finds or creates a profile application for the specifiedprofile.- Parameters:
profile- to find or createProfileApplicationfor.profile-- Returns:
- found or created
ProfileApplication.
-
setProfileApplicationResource
Sets theResourcecontaining the profile application.- Parameters:
resource- which contains a profile application- Throws:
IOException- if loading to resource fails.IOException
-
removeEObject
Removes the specifiedEObjectfrom managedProfileApplication- Parameters:
eObject-
-
addNestedEObject
Adds an instance of nested object to the reference of the container.- Parameters:
container-eReference-eObject-
-