Class StereotypeAPI
java.lang.Object
org.palladiosimulator.mdsdprofiles.api.StereotypeAPI
API to apply, update, query, and unapply stereotypes for an EObject.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyStereotype(EObject stereotypedElement, String stereotypeName) static voidapplyStereotype(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 EStructuralFeaturegetParameter(org.modelversioning.emfprofile.Stereotype stereotype, String parameterName) Returns theEStructuralFeaturethat defines the given parameter (identified by its name).static Collection<EStructuralFeature>getParameters(org.modelversioning.emfprofile.Stereotype stereotype) Returns theEStructuralFeatures that define theStereotype`s parameters.static org.modelversioning.emfprofileapplication.StereotypeApplicationgetStereotypeApplication(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 booleanhasAppliedStereotype(Set<? extends EObject> setOfElements, String stereotypeName) Checks whether anyEObjectin the given set has a stereotype with the given name applied.static booleanhasStereotypeApplications(EObject stereotypedElement) static booleanisStereotypeApplicable(EObject stereotypedElement, String stereotypeName) static booleanisStereotypeApplicable(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype) static booleanisStereotypeApplied(EObject stereotypedElement, String stereotype) static booleanisStereotypeApplied(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype) static voidsetTaggedValue(EObject stereotypedElement, Object newValue, String stereotypeName, String taggedValueName) Sets the specified tagged value on theStereotype.static voidunapplyStereotype(EObject stereotypedElement, String stereotypeName) static voidunapplyStereotype(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype) static booleanupdateStereotypeApplications(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 anyEObjectin the given set has a stereotype with the given name applied.- Parameters:
setOfElements- the set of EObjectsstereotypeName- the stereotype name- Returns:
trueif there is at least one stereotype application of the given stereotype to an element of the given set;falseotherwise.
-
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 theEMFProfileand theStereotypeare applied to it. If this is not the case, an emptyOptionalis 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 theEStructuralFeatures 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 theEStructuralFeaturethat defines the given parameter (identified by its name).- Parameters:
stereotype- theStereotypeparameterName- the parameter`s name- Returns:
- the parameter`s
EStructuralFeature
-