Interface IProfileFacade
- All Known Implementing Classes:
ProfileFacadeImpl
StereotypeApplication
s.-
Field Summary
Modifier and TypeFieldDescriptionstatic final EMFProfileApplicationFactory
TheEMFProfileApplicationPackage
instance.static final EMFProfileApplicationPackage
TheEMFProfileApplicationPackage
instance.static final EMFProfileFactory
TheEMFProfileFactory
instancestatic final EMFProfilePackage
TheEMFProfilePackage
instance.static final EClass
TheProfileApplication
EClass
.static final EReference
TheEReference
used to apply stereotypes.static final EClass
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addNestedEObject
(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 specifiedstereotype
to the specifiedeObject
.apply
(Stereotype stereotype, EObject eObject, Extension extension) Applies the specifiedstereotype
to the specifiedeObject
using 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 ofStereotypeApplication
s).Returns the list of currently loadedProfile
s.When loading profile application resource, this method is used to get a reference toProfileApplication
Returns allStereotypeApplications
handled by this facade.getStereotypeFeatures
(Stereotype stereotype) Returns the list ofEStructuralFeature
s that can be set for the specifiedstereotype
.getTaggedValue
(EObject stereotypeApplication, EStructuralFeature taggedValue) Returns the value of the giventaggedValue
of the givenstereotypeApplication
.boolean
isApplicable
(Stereotype stereotype, EObject eObject) Specifies whether thestereotype
is applicable toeObject
.boolean
isApplicable
(Stereotype stereotype, EObject eObject, Extension extension) Specifies whether thestereotype
is applicable toeObject
using the specifiedextension
.void
loadProfile
(Profile profile) Loads the specifiedprofile
.void
loadProfiles
(EList<Profile> profiles) Loads the specifiedprofiles
.void
loadProfiles
(Resource resource) Loads allProfile
s contained by the specifiedresource
.void
makeApplicable
(Profile profile) Turns the specifiedprofile
into an applicable profile.void
removeEObject
(EObject eObject) Removes the specifiedEObject
from managedProfileApplication
void
removeStereotypeApplication
(StereotypeApplication stereotypeApplication) Removes the specifiedStereotypeApplication
.void
save()
Saves the currently set profile application resource.void
setProfileApplicationFileAndInitializeResource
(IFile profileApplicationFile, ResourceSet resourceSet) Sets theIFile
containing the profile application and initializes a resource.void
setProfileApplicationResource
(Resource resource) Sets theResource
containing the profile application.void
setTaggedValue
(EObject stereotypeApplication, EStructuralFeature taggedValue, Object newValue) Sets the value of the giventaggedValue
of thestereotypeApplication
to the new value.void
unload()
Unloads this facade.void
unloadProfile
(Profile profile) Unloads the specifiedprofile
.validateAll
(EObject currentlySelectedEObject) Validates the entire profile application.
-
Field Details
-
EMF_PROFILE_PACKAGE
TheEMFProfilePackage
instance. -
EMF_PROFILE_FACTORY
TheEMFProfileFactory
instance -
EMF_PROFILE_APPLICATION_FACTORY
TheEMFProfileApplicationPackage
instance. -
EMF_PROFILE_APPLICATION_PACKAGE
TheEMFProfileApplicationPackage
instance. -
PROFILE_APPLICATION_ECLASS
TheProfileApplication
EClass
. -
STEREOTYPE_APPLICATION_ECLASS
-
STEREOTYPE_APPLICATION_APPLIED_TO_REFERENCE
TheEReference
used to apply stereotypes.
-
-
Method Details
-
makeApplicable
Turns the specified
profile
into an applicable profile.This method can be called without being initialized by loading a
Profile
of an application.- Parameters:
profile
- to turn into an applicable profile.
-
loadProfile
Loads the specifiedprofile
.- Parameters:
profile
- theProfile
to load.
-
unloadProfile
Unloads the specifiedprofile
.- Parameters:
profile
- theProfile
to unload.
-
loadProfiles
Loads allProfile
s contained by the specifiedresource
.- Parameters:
resource
- containing the profiles to be loaded.
-
loadProfiles
Loads the specifiedprofiles
.- Parameters:
profiles
- theProfile
s to be loaded.
-
getLoadedProfiles
Returns the list of currently loadedProfile
s.- Returns:
- the list of currently loaded
Profile
s.
-
setProfileApplicationFileAndInitializeResource
void setProfileApplicationFileAndInitializeResource(IFile profileApplicationFile, ResourceSet resourceSet) throws IOException Sets theIFile
containing 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
Stereotype
s.
-
getApplicableStereotypes
Returns the list of applicable stereotype for the specifiedeObject
.- Parameters:
eObject
- to get applicable stereotype for.- Returns:
- the list of applicable
Stereotype
s.
-
apply
Applies the specifiedstereotype
to the specifiedeObject
.This method creates a new instance of the specified
Stereotype
and 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 thestereotype
to.- Returns:
- the created instance of the
Stereotype
.
-
apply
Applies the specifiedstereotype
to the specifiedeObject
using the specifiedextension
.This method creates a new instance of the specified
Stereotype
and 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 thestereotype
to.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 theapplicableStereotype
to.- Returns:
- the created instance of the
Stereotype
.
-
getStereotypeApplications
EList<StereotypeApplication> getStereotypeApplications()Returns allStereotypeApplications
handled by this facade.- Returns:
- all
StereotypeApplications
-
getAppliedStereotypes
Returns all stereotypes currently applied to the specifiedeObject
(list ofStereotypeApplication
s).- Parameters:
eObject
- to get applied stereotypes for.- Returns:
- the list of
StereotypeApplication
s.
-
isApplicable
Specifies whether thestereotype
is applicable toeObject
.- Parameters:
stereotype
- to check.eObject
- to check.- Returns:
true
if applicable, otherwisefalse
.
-
isApplicable
Specifies whether thestereotype
is applicable toeObject
using the specifiedextension
.- Parameters:
stereotype
- to check.eObject
- to check.extension
- the extension to check.- Returns:
true
if applicable, otherwisefalse
.
-
getStereotypeFeatures
Returns the list ofEStructuralFeature
s that can be set for the specifiedstereotype
.- Parameters:
stereotype
- to getEStructuralFeature
s for.- Returns:
- the list of settable
EStructuralFeature
s.
-
getTaggedValue
Returns the value of the giventaggedValue
of the givenstereotypeApplication
.If the tagged value is
many-valued
, the result will be anEList
and each object in the list will bean instance of
the feature'stype
; the list's contents are not affected byresolve
argument. 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 giventaggedValue
of thestereotypeApplication
to the new value.If the feature is
many-valued
, the new value must be anEList
and each object in that list must bean instance of
the 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 consideredset
if 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 createProfileApplication
for.profile
-- Returns:
- found or created
ProfileApplication
.
-
setProfileApplicationResource
Sets theResource
containing the profile application.- Parameters:
resource
- which contains a profile application- Throws:
IOException
- if loading to resource fails.IOException
-
removeEObject
Removes the specifiedEObject
from managedProfileApplication
- Parameters:
eObject
-
-
addNestedEObject
Adds an instance of nested object to the reference of the container.- Parameters:
container
-eReference
-eObject
-
-