Class StereotypeAPI
java.lang.Object
org.palladiosimulator.mdsdprofiles.api.StereotypeAPI
API to apply, update, query, and unapply stereotypes for an EObject.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyStereotype
(EObject stereotypedElement, String stereotypeName) static void
applyStereotype
(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype) static EList<org.modelversioning.emfprofile.Stereotype>
getApplicableStereotypes
(EObject stereotypedElement) static EList<org.modelversioning.emfprofile.Stereotype>
getApplicableStereotypes
(EObject stereotypedElement, String stereotypeName) static EList<org.modelversioning.emfprofile.Stereotype>
getApplicableStereotypes
(EObject stereotypedElement, org.modelversioning.emfprofile.Profile profile) static EList<org.modelversioning.emfprofile.Stereotype>
getAppliedStereotypes
(EObject stereotypedElement) static EStructuralFeature
getParameter
(org.modelversioning.emfprofile.Stereotype stereotype, String parameterName) Returns theEStructuralFeature
that defines the given parameter (identified by its name).static Collection<EStructuralFeature>
getParameters
(org.modelversioning.emfprofile.Stereotype stereotype) Returns theEStructuralFeature
s that define theStereotype
`s parameters.static org.modelversioning.emfprofileapplication.StereotypeApplication
getStereotypeApplication
(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype) static EList<org.modelversioning.emfprofileapplication.StereotypeApplication>
getStereotypeApplications
(EObject stereotypedElement) static EList<org.modelversioning.emfprofileapplication.StereotypeApplication>
getStereotypeApplications
(EObject stereotypedElement, String stereotype) static EList<org.modelversioning.emfprofileapplication.StereotypeApplication>
getStereotypeApplications
(EObject stereotypedElement, org.modelversioning.emfprofile.Profile profile) static <DATA_TYPE>
DATA_TYPEgetTaggedValue
(EObject stereotypedElement, String taggedValueName, String stereotypeName) Returns the tagged value of the specifiedStereotype
.static <DATA_TYPE>
Optional<DATA_TYPE>getTaggedValueSafe
(EObject stereotypedElement, String taggedValueName, String stereotypeName) Returns the tagged value of the specifiedEObject
.static boolean
hasAppliedStereotype
(Set<? extends EObject> setOfElements, String stereotypeName) Checks whether anyEObject
in the given set has a stereotype with the given name applied.static boolean
hasStereotypeApplications
(EObject stereotypedElement) static boolean
isStereotypeApplicable
(EObject stereotypedElement, String stereotypeName) static boolean
isStereotypeApplicable
(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype) static boolean
isStereotypeApplied
(EObject stereotypedElement, String stereotype) static boolean
isStereotypeApplied
(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype) static void
setTaggedValue
(EObject stereotypedElement, Object newValue, String stereotypeName, String taggedValueName) Sets the specified tagged value on theStereotype
.static void
unapplyStereotype
(EObject stereotypedElement, String stereotypeName) static void
unapplyStereotype
(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype) static boolean
updateStereotypeApplications
(EObject stereotypedElement, EList<org.modelversioning.emfprofile.Stereotype> stereotypesToBeApplied)
-
Constructor Details
-
StereotypeAPI
public StereotypeAPI()
-
-
Method Details
-
applyStereotype
public static void applyStereotype(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype) -
applyStereotype
-
updateStereotypeApplications
-
setTaggedValue
public static void setTaggedValue(EObject stereotypedElement, Object newValue, String stereotypeName, String taggedValueName) Sets the specified tagged value on theStereotype
.- Parameters:
stereotypedElement
- the entity on which the stereotype is applied.newValue
- the value to be setstereotypeName
- the stereotype`s nametaggedValueName
- the tagged value`s name
-
isStereotypeApplicable
public static boolean isStereotypeApplicable(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype) -
isStereotypeApplicable
-
isStereotypeApplied
public static boolean isStereotypeApplied(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype) -
isStereotypeApplied
-
hasStereotypeApplications
-
hasAppliedStereotype
public static boolean hasAppliedStereotype(Set<? extends EObject> setOfElements, String stereotypeName) Checks whether anyEObject
in the given set has a stereotype with the given name applied.- Parameters:
setOfElements
- the set of EObjectsstereotypeName
- the stereotype name- Returns:
true
if there is at least one stereotype application of the given stereotype to an element of the given set;false
otherwise.
-
getApplicableStereotypes
-
getApplicableStereotypes
-
getApplicableStereotypes
-
getStereotypeApplications
-
getStereotypeApplications
-
getStereotypeApplications
-
getStereotypeApplication
public static org.modelversioning.emfprofileapplication.StereotypeApplication getStereotypeApplication(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype) -
getAppliedStereotypes
-
getTaggedValue
public static <DATA_TYPE> DATA_TYPE getTaggedValue(EObject stereotypedElement, String taggedValueName, String stereotypeName) Returns the tagged value of the specifiedStereotype
.- Parameters:
pcmEntity
- the entity on which the stereotype is appliedtaggedValueName
- the tagged value`s namestereotypeName
- the stereotype`s name- Returns:
- the value
-
getTaggedValueSafe
public static <DATA_TYPE> Optional<DATA_TYPE> getTaggedValueSafe(EObject stereotypedElement, String taggedValueName, String stereotypeName) Returns the tagged value of the specifiedEObject
. This ensures that both theEMFProfile
and theStereotype
are applied to it. If this is not the case, an emptyOptional
is returned.- Type Parameters:
DATA_TYPE
- the data type of the tagged value- Parameters:
stereotypedElement
- the entity on which the stereotype is appliedtaggedValueName
- the tagged value`s namestereotypeName
- the stereotype`s name- Returns:
- the tagged value of the specified
EObject
- See Also:
-
unapplyStereotype
public static void unapplyStereotype(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype) -
unapplyStereotype
-
getParameters
public static Collection<EStructuralFeature> getParameters(org.modelversioning.emfprofile.Stereotype stereotype) Returns theEStructuralFeature
s that define theStereotype
`s parameters.- Parameters:
stereotype
- theStereotype
- Returns:
- the parameters` features
-
getParameter
public static EStructuralFeature getParameter(org.modelversioning.emfprofile.Stereotype stereotype, String parameterName) Returns theEStructuralFeature
that defines the given parameter (identified by its name).- Parameters:
stereotype
- theStereotype
parameterName
- the parameter`s name- Returns:
- the parameter`s
EStructuralFeature
-