Class StereotypeAPI
- java.lang.Object
-
- org.palladiosimulator.mdsdprofiles.api.StereotypeAPI
-
public class StereotypeAPI extends Object
API to apply, update, query, and unapply stereotypes for an EObject.
-
-
Constructor Summary
Constructors Constructor Description StereotypeAPI()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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)
-
-
-
Method Detail
-
applyStereotype
public static void applyStereotype(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype)
-
applyStereotype
public static void applyStereotype(EObject stereotypedElement, String stereotypeName)
-
updateStereotypeApplications
public static boolean updateStereotypeApplications(EObject stereotypedElement, EList<org.modelversioning.emfprofile.Stereotype> stereotypesToBeApplied)
-
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
public static boolean isStereotypeApplicable(EObject stereotypedElement, String stereotypeName)
-
isStereotypeApplied
public static boolean isStereotypeApplied(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype)
-
isStereotypeApplied
public static boolean isStereotypeApplied(EObject stereotypedElement, String stereotype)
-
hasStereotypeApplications
public static boolean hasStereotypeApplications(EObject stereotypedElement)
-
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
public static EList<org.modelversioning.emfprofile.Stereotype> getApplicableStereotypes(EObject stereotypedElement)
-
getApplicableStereotypes
public static EList<org.modelversioning.emfprofile.Stereotype> getApplicableStereotypes(EObject stereotypedElement, org.modelversioning.emfprofile.Profile profile)
-
getApplicableStereotypes
public static EList<org.modelversioning.emfprofile.Stereotype> getApplicableStereotypes(EObject stereotypedElement, String stereotypeName)
-
getStereotypeApplications
public static EList<org.modelversioning.emfprofileapplication.StereotypeApplication> getStereotypeApplications(EObject stereotypedElement)
-
getStereotypeApplications
public static EList<org.modelversioning.emfprofileapplication.StereotypeApplication> getStereotypeApplications(EObject stereotypedElement, org.modelversioning.emfprofile.Profile profile)
-
getStereotypeApplications
public static EList<org.modelversioning.emfprofileapplication.StereotypeApplication> getStereotypeApplications(EObject stereotypedElement, String stereotype)
-
getStereotypeApplication
public static org.modelversioning.emfprofileapplication.StereotypeApplication getStereotypeApplication(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype)
-
getAppliedStereotypes
public static EList<org.modelversioning.emfprofile.Stereotype> getAppliedStereotypes(EObject stereotypedElement)
-
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:
getTaggedValue(EObject, String, String)
-
unapplyStereotype
public static void unapplyStereotype(EObject stereotypedElement, org.modelversioning.emfprofile.Stereotype stereotype)
-
unapplyStereotype
public static void unapplyStereotype(EObject stereotypedElement, String stereotypeName)
-
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
-
-