Interface IProfileFacade
-
- All Known Implementing Classes:
ProfileFacadeImpl
public interface IProfileFacade
Interface for the facade to process and create profile andStereotypeApplication
s.
-
-
Field Summary
Fields Modifier and Type Field Description static EMFProfileApplicationFactory
EMF_PROFILE_APPLICATION_FACTORY
TheEMFProfileApplicationPackage
instance.static EMFProfileApplicationPackage
EMF_PROFILE_APPLICATION_PACKAGE
TheEMFProfileApplicationPackage
instance.static EMFProfileFactory
EMF_PROFILE_FACTORY
TheEMFProfileFactory
instancestatic EMFProfilePackage
EMF_PROFILE_PACKAGE
TheEMFProfilePackage
instance.static EClass
PROFILE_APPLICATION_ECLASS
TheProfileApplication
EClass
.static EReference
STEREOTYPE_APPLICATION_APPLIED_TO_REFERENCE
TheEReference
used to apply stereotypes.static EClass
STEREOTYPE_APPLICATION_ECLASS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addNestedEObject(EObject container, EReference eReference, EObject eObject)
Adds an instance of nested object to the reference of the container.StereotypeApplication
apply(Stereotype stereotype, EObject eObject)
Applies the specifiedstereotype
to the specifiedeObject
.StereotypeApplication
apply(Stereotype stereotype, EObject eObject, Extension extension)
Applies the specifiedstereotype
to the specifiedeObject
using the specifiedextension
.StereotypeApplication
apply(StereotypeApplicability stereotypeApplicability, EObject eObject)
Applies the specifiedapplicableStereotype
.ProfileApplication
findOrCreateProfileApplication(Profile profile)
Finds or creates a profile application for the specifiedprofile
.EList<StereotypeApplicability>
getApplicableStereotypes(EClass eClass)
Returns the list of applicable stereotype for the specified type ineClass
.EList<StereotypeApplicability>
getApplicableStereotypes(EObject eObject)
Returns the list of applicable stereotype for the specifiedeObject
.EList<StereotypeApplication>
getAppliedStereotypes(EObject eObject)
Returns all stereotypes currently applied to the specifiedeObject
(list ofStereotypeApplication
s).EList<Profile>
getLoadedProfiles()
Returns the list of currently loadedProfile
s.Resource
getProfileApplicationResource()
EList<ProfileApplication>
getProfileApplications()
When loading profile application resource, this method is used to get a reference toProfileApplication
EList<StereotypeApplication>
getStereotypeApplications()
Returns allStereotypeApplications
handled by this facade.EList<EStructuralFeature>
getStereotypeFeatures(Stereotype stereotype)
Returns the list ofEStructuralFeature
s that can be set for the specifiedstereotype
.Object
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
.Diagnostic
validateAll(EObject currentlySelectedEObject)
Validates the entire profile application.
-
-
-
Field Detail
-
EMF_PROFILE_PACKAGE
static final EMFProfilePackage EMF_PROFILE_PACKAGE
TheEMFProfilePackage
instance.
-
EMF_PROFILE_FACTORY
static final EMFProfileFactory EMF_PROFILE_FACTORY
TheEMFProfileFactory
instance
-
EMF_PROFILE_APPLICATION_FACTORY
static final EMFProfileApplicationFactory EMF_PROFILE_APPLICATION_FACTORY
TheEMFProfileApplicationPackage
instance.
-
EMF_PROFILE_APPLICATION_PACKAGE
static final EMFProfileApplicationPackage EMF_PROFILE_APPLICATION_PACKAGE
TheEMFProfileApplicationPackage
instance.
-
PROFILE_APPLICATION_ECLASS
static final EClass PROFILE_APPLICATION_ECLASS
TheProfileApplication
EClass
.
-
STEREOTYPE_APPLICATION_ECLASS
static final EClass STEREOTYPE_APPLICATION_ECLASS
-
STEREOTYPE_APPLICATION_APPLIED_TO_REFERENCE
static final EReference STEREOTYPE_APPLICATION_APPLIED_TO_REFERENCE
TheEReference
used to apply stereotypes.
-
-
Method Detail
-
makeApplicable
void makeApplicable(Profile profile)
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
void loadProfile(Profile profile)
Loads the specifiedprofile
.- Parameters:
profile
- theProfile
to load.
-
unloadProfile
void unloadProfile(Profile profile)
Unloads the specifiedprofile
.- Parameters:
profile
- theProfile
to unload.
-
loadProfiles
void loadProfiles(Resource resource)
Loads allProfile
s contained by the specifiedresource
.- Parameters:
resource
- containing the profiles to be loaded.
-
loadProfiles
void loadProfiles(EList<Profile> profiles)
Loads the specifiedprofiles
.- Parameters:
profiles
- theProfile
s to be loaded.
-
getLoadedProfiles
EList<Profile> 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
EList<StereotypeApplicability> getApplicableStereotypes(EClass eClass)
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
EList<StereotypeApplicability> getApplicableStereotypes(EObject eObject)
Returns the list of applicable stereotype for the specifiedeObject
.- Parameters:
eObject
- to get applicable stereotype for.- Returns:
- the list of applicable
Stereotype
s.
-
apply
StereotypeApplication apply(Stereotype stereotype, EObject eObject)
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
StereotypeApplication apply(Stereotype stereotype, EObject eObject, Extension extension)
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
StereotypeApplication apply(StereotypeApplicability stereotypeApplicability, EObject eObject)
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
EList<StereotypeApplication> getAppliedStereotypes(EObject eObject)
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
boolean isApplicable(Stereotype stereotype, EObject eObject)
Specifies whether thestereotype
is applicable toeObject
.- Parameters:
stereotype
- to check.eObject
- to check.- Returns:
true
if applicable, otherwisefalse
.
-
isApplicable
boolean isApplicable(Stereotype stereotype, EObject eObject, Extension extension)
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
EList<EStructuralFeature> getStereotypeFeatures(Stereotype stereotype)
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
Object getTaggedValue(EObject stereotypeApplication, EStructuralFeature taggedValue)
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
void setTaggedValue(EObject stereotypeApplication, EStructuralFeature taggedValue, Object newValue)
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
void save() throws IOException
Saves the currently set profile application resource.- Throws:
IOException
- if writing to file fails.
-
unload
void unload()
Unloads this facade.
-
removeStereotypeApplication
void removeStereotypeApplication(StereotypeApplication stereotypeApplication)
Removes the specifiedStereotypeApplication
.- Parameters:
stereotypeApplication
- stereotype application to remove.
-
validateAll
Diagnostic validateAll(EObject currentlySelectedEObject)
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
ProfileApplication findOrCreateProfileApplication(Profile profile)
Finds or creates a profile application for the specifiedprofile
.- Parameters:
profile
- to find or createProfileApplication
for.profile
-- Returns:
- found or created
ProfileApplication
.
-
setProfileApplicationResource
void setProfileApplicationResource(Resource resource) throws IOException
Sets theResource
containing the profile application.- Parameters:
resource
- which contains a profile application- Throws:
IOException
- if loading to resource fails.IOException
-
removeEObject
void removeEObject(EObject eObject)
Removes the specifiedEObject
from managedProfileApplication
- Parameters:
eObject
-
-
addNestedEObject
void addNestedEObject(EObject container, EReference eReference, EObject eObject)
Adds an instance of nested object to the reference of the container.- Parameters:
container
-eReference
-eObject
-
-
-