Interface IProfileFacade

All Known Implementing Classes:
ProfileFacadeImpl

public interface IProfileFacade
Interface for the facade to process and create profile and StereotypeApplications.
  • Field Details

  • Method Details

    • 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 specified profile.
      Parameters:
      profile - the Profile to load.
    • unloadProfile

      void unloadProfile(Profile profile)
      Unloads the specified profile.
      Parameters:
      profile - the Profile to unload.
    • loadProfiles

      void loadProfiles(Resource resource)
      Loads all Profiles contained by the specified resource.
      Parameters:
      resource - containing the profiles to be loaded.
    • loadProfiles

      void loadProfiles(EList<Profile> profiles)
      Loads the specified profiles.
      Parameters:
      profiles - the Profiles to be loaded.
    • getLoadedProfiles

      EList<Profile> getLoadedProfiles()
      Returns the list of currently loaded Profiles.
      Returns:
      the list of currently loaded Profiles.
    • setProfileApplicationFileAndInitializeResource

      void setProfileApplicationFileAndInitializeResource(IFile profileApplicationFile, ResourceSet resourceSet) throws IOException
      Sets the IFile 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 in eClass.
      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 specified eObject.
      Parameters:
      eObject - to get applicable stereotype for.
      Returns:
      the list of applicable Stereotypes.
    • apply

      StereotypeApplication apply(Stereotype stereotype, EObject eObject)
      Applies the specified stereotype to the specified eObject.

      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 an IllegalStateException.

      Parameters:
      stereotype - to apply.
      eObject - to apply the stereotype to.
      Returns:
      the created instance of the Stereotype.
    • apply

      StereotypeApplication apply(Stereotype stereotype, EObject eObject, Extension extension)
      Applies the specified stereotype to the specified eObject using the specified extension.

      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 an IllegalStateException.

      Parameters:
      stereotype - to apply.
      eObject - to apply the stereotype 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 specified applicableStereotype.

      This method is a convenience method for apply(Stereotype, EObject, Extension).

      Parameters:
      stereotypeApplicability - the applicable stereotype to be applied.
      eObject - to apply the applicableStereotype to.
      Returns:
      the created instance of the Stereotype.
    • getStereotypeApplications

      EList<StereotypeApplication> getStereotypeApplications()
      Returns all StereotypeApplications handled by this facade.
      Returns:
      all StereotypeApplications
    • getAppliedStereotypes

      EList<StereotypeApplication> getAppliedStereotypes(EObject eObject)
      Returns all stereotypes currently applied to the specified eObject (list of StereotypeApplications).
      Parameters:
      eObject - to get applied stereotypes for.
      Returns:
      the list of StereotypeApplications.
    • isApplicable

      boolean isApplicable(Stereotype stereotype, EObject eObject)
      Specifies whether the stereotype is applicable to eObject.
      Parameters:
      stereotype - to check.
      eObject - to check.
      Returns:
      true if applicable, otherwise false.
    • isApplicable

      boolean isApplicable(Stereotype stereotype, EObject eObject, Extension extension)
      Specifies whether the stereotype is applicable to eObject using the specified extension.
      Parameters:
      stereotype - to check.
      eObject - to check.
      extension - the extension to check.
      Returns:
      true if applicable, otherwise false.
    • getStereotypeFeatures

      EList<EStructuralFeature> getStereotypeFeatures(Stereotype stereotype)
      Returns the list of EStructuralFeatures that can be set for the specified stereotype.
      Parameters:
      stereotype - to get EStructuralFeatures for.
      Returns:
      the list of settable EStructuralFeatures.
    • getTaggedValue

      Object getTaggedValue(EObject stereotypeApplication, EStructuralFeature taggedValue)
      Returns the value of the given taggedValue of the given stereotypeApplication.

      If the tagged value is many-valued, the result will be an EList and each object in the list will be an instance of the feature's type; the list's contents are not affected by resolve argument. Otherwise the result directly will be an instance of the feature's type; if it is a proxy, 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 given taggedValue of the stereotypeApplication to the new value.

      If the feature is many-valued, the new value must be an EList and each object in that list must be an instance of the feature's type; 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 is unsettable, the modeled state becomes set; otherwise, the feature may still not considered set 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 the meta class's features, or it isn't changeable.
      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 specified StereotypeApplication.
      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 to ProfileApplication
      Returns:
    • findOrCreateProfileApplication

      ProfileApplication findOrCreateProfileApplication(Profile profile)
      Finds or creates a profile application for the specified profile.
      Parameters:
      profile - to find or create ProfileApplication for.
      profile -
      Returns:
      found or created ProfileApplication.
    • setProfileApplicationResource

      void setProfileApplicationResource(Resource resource) throws IOException
      Sets the Resource 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 specified EObject from managed ProfileApplication
      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 -