Interface IProfileFacade
-
- All Known Implementing Classes:
ProfileFacadeImpl
public interface IProfileFacadeInterface for the facade to process and create profile andStereotypeApplications.
-
-
Field Summary
Fields Modifier and Type Field Description static EMFProfileApplicationFactoryEMF_PROFILE_APPLICATION_FACTORYTheEMFProfileApplicationPackageinstance.static EMFProfileApplicationPackageEMF_PROFILE_APPLICATION_PACKAGETheEMFProfileApplicationPackageinstance.static EMFProfileFactoryEMF_PROFILE_FACTORYTheEMFProfileFactoryinstancestatic EMFProfilePackageEMF_PROFILE_PACKAGETheEMFProfilePackageinstance.static EClassPROFILE_APPLICATION_ECLASSTheProfileApplicationEClass.static EReferenceSTEREOTYPE_APPLICATION_APPLIED_TO_REFERENCETheEReferenceused to apply stereotypes.static EClassSTEREOTYPE_APPLICATION_ECLASS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddNestedEObject(EObject container, EReference eReference, EObject eObject)Adds an instance of nested object to the reference of the container.StereotypeApplicationapply(Stereotype stereotype, EObject eObject)Applies the specifiedstereotypeto the specifiedeObject.StereotypeApplicationapply(Stereotype stereotype, EObject eObject, Extension extension)Applies the specifiedstereotypeto the specifiedeObjectusing the specifiedextension.StereotypeApplicationapply(StereotypeApplicability stereotypeApplicability, EObject eObject)Applies the specifiedapplicableStereotype.ProfileApplicationfindOrCreateProfileApplication(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 ofStereotypeApplications).EList<Profile>getLoadedProfiles()Returns the list of currently loadedProfiles.ResourcegetProfileApplicationResource()EList<ProfileApplication>getProfileApplications()When loading profile application resource, this method is used to get a reference toProfileApplicationEList<StereotypeApplication>getStereotypeApplications()Returns allStereotypeApplicationshandled by this facade.EList<EStructuralFeature>getStereotypeFeatures(Stereotype stereotype)Returns the list ofEStructuralFeatures that can be set for the specifiedstereotype.ObjectgetTaggedValue(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.DiagnosticvalidateAll(EObject currentlySelectedEObject)Validates the entire profile application.
-
-
-
Field Detail
-
EMF_PROFILE_PACKAGE
static final EMFProfilePackage EMF_PROFILE_PACKAGE
TheEMFProfilePackageinstance.
-
EMF_PROFILE_FACTORY
static final EMFProfileFactory EMF_PROFILE_FACTORY
TheEMFProfileFactoryinstance
-
EMF_PROFILE_APPLICATION_FACTORY
static final EMFProfileApplicationFactory EMF_PROFILE_APPLICATION_FACTORY
TheEMFProfileApplicationPackageinstance.
-
EMF_PROFILE_APPLICATION_PACKAGE
static final EMFProfileApplicationPackage EMF_PROFILE_APPLICATION_PACKAGE
TheEMFProfileApplicationPackageinstance.
-
PROFILE_APPLICATION_ECLASS
static final EClass PROFILE_APPLICATION_ECLASS
TheProfileApplicationEClass.
-
STEREOTYPE_APPLICATION_ECLASS
static final EClass STEREOTYPE_APPLICATION_ECLASS
-
STEREOTYPE_APPLICATION_APPLIED_TO_REFERENCE
static final EReference STEREOTYPE_APPLICATION_APPLIED_TO_REFERENCE
TheEReferenceused to apply stereotypes.
-
-
Method Detail
-
makeApplicable
void makeApplicable(Profile profile)
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
void loadProfile(Profile profile)
Loads the specifiedprofile.- Parameters:
profile- theProfileto load.
-
unloadProfile
void unloadProfile(Profile profile)
Unloads the specifiedprofile.- Parameters:
profile- theProfileto unload.
-
loadProfiles
void loadProfiles(Resource resource)
Loads allProfiles contained by the specifiedresource.- Parameters:
resource- containing the profiles to be loaded.
-
loadProfiles
void loadProfiles(EList<Profile> profiles)
Loads the specifiedprofiles.- Parameters:
profiles- theProfiles to be loaded.
-
getLoadedProfiles
EList<Profile> 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
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
Stereotypes.
-
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
Stereotypes.
-
apply
StereotypeApplication apply(Stereotype stereotype, EObject eObject)
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
StereotypeApplication apply(Stereotype stereotype, EObject eObject, Extension extension)
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
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 theapplicableStereotypeto.- Returns:
- the created instance of the
Stereotype.
-
getStereotypeApplications
EList<StereotypeApplication> getStereotypeApplications()
Returns allStereotypeApplicationshandled by this facade.- Returns:
- all
StereotypeApplications
-
getAppliedStereotypes
EList<StereotypeApplication> getAppliedStereotypes(EObject eObject)
Returns all stereotypes currently applied to the specifiedeObject(list ofStereotypeApplications).- Parameters:
eObject- to get applied stereotypes for.- Returns:
- the list of
StereotypeApplications.
-
isApplicable
boolean isApplicable(Stereotype stereotype, EObject eObject)
Specifies whether thestereotypeis applicable toeObject.- Parameters:
stereotype- to check.eObject- to check.- Returns:
trueif applicable, otherwisefalse.
-
isApplicable
boolean isApplicable(Stereotype stereotype, EObject eObject, Extension extension)
Specifies whether thestereotypeis applicable toeObjectusing the specifiedextension.- Parameters:
stereotype- to check.eObject- to check.extension- the extension to check.- Returns:
trueif applicable, otherwisefalse.
-
getStereotypeFeatures
EList<EStructuralFeature> getStereotypeFeatures(Stereotype stereotype)
Returns the list ofEStructuralFeatures that can be set for the specifiedstereotype.- Parameters:
stereotype- to getEStructuralFeatures for.- Returns:
- the list of settable
EStructuralFeatures.
-
getTaggedValue
Object getTaggedValue(EObject stereotypeApplication, EStructuralFeature taggedValue)
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
void setTaggedValue(EObject stereotypeApplication, EStructuralFeature taggedValue, Object newValue)
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
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 createProfileApplicationfor.profile-- Returns:
- found or created
ProfileApplication.
-
setProfileApplicationResource
void setProfileApplicationResource(Resource resource) throws IOException
Sets theResourcecontaining 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 specifiedEObjectfrom 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-
-
-