Package com.nomagic.uml2.ext.jmi.helpers
Class DeprecatedStereotypesHelper
java.lang.Object
com.nomagic.uml2.ext.jmi.helpers.DeprecatedTagsHelper
com.nomagic.uml2.ext.jmi.helpers.DeprecatedStereotypesHelper
- Direct Known Subclasses:
TagsHelper
Utility class to work with stereotypes. It has only deprecated methods for API compatibility.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addStereotypeByString
(Element element, String stereotype) Deprecated.static void
addStereotypeByString
(Element element, String stereotype, String profileName) Deprecated.static void
addStereotypesWithNames
(Element element, Collection<String> stereotypesNames) Deprecated.getExtendedElements
(Stereotype stereotype) Deprecated.useStereotypesHelper.getStereotypedElements(Stereotype)
as it has better naming of the methodstatic Collection<Element>
getExtendedElementsIncludingDerived
(Stereotype stereotype) Deprecated.useStereotypesHelper.getStereotypedElementsIncludingDerived(Stereotype)
as it has better naming of the methodstatic Stereotype
getStereotype
(Project project, String stereotypeName) Deprecated.this method returns first found stereotype from the project.static Stereotype
getStereotype
(Project project, String stereotypeName, String profileName) Deprecated.this method is not suitable when project contains more than one profile with same name but different URI.static List
getStereotypePropertyValue
(Element element, Stereotype stereotype, Property tagDefinition) Deprecated.static List
getStereotypePropertyValue
(Element element, Stereotype stereotype, Property tagDefinition, boolean calculateDerived) static boolean
hasExtendedElements
(Stereotype stereotype) Deprecated.useStereotypesHelper.hasStereotypedElements(Stereotype)
as it has better naming of the methodstatic boolean
hasStereotype
(Element element, String stereotype) Deprecated.static boolean
hasStereotype
(Element element, String stereotypeName, String profileName) Deprecated.this method is not suitable when project contains more than one profile with same name but different URI.static boolean
hasStereotypeOrDerived
(Element element, String stereotypeName) Deprecated.static boolean
isElementStereotypedBy
(Element element, String stereotypeName) Deprecated.static void
removeStereotypeByString
(Element element, String stereotype) Deprecated.Methods inherited from class com.nomagic.uml2.ext.jmi.helpers.DeprecatedTagsHelper
clearStereotypeProperty, clearStereotypeProperty, getStereotypePropertyFirst, getStereotypePropertyFirst, getStereotypePropertyValue, getStereotypePropertyValue, getStereotypePropertyValueAsString, getStereotypePropertyValueAsString
-
Field Details
-
INVISIBLE_STEREOTYPE_NAME
Deprecated.Name of invisible stereotype- See Also:
-
METAMODEL
Deprecated.Name of metamodel stereotype- See Also:
-
-
Constructor Details
-
DeprecatedStereotypesHelper
public DeprecatedStereotypesHelper()
-
-
Method Details
-
hasStereotype
@Deprecated public static boolean hasStereotype(Element element, String stereotypeName, String profileName) throws IllegalArgumentException Deprecated.this method is not suitable when project contains more than one profile with same name but different URI. UseStereotypesHelper.hasStereotype(Element, Stereotype)
Checks if element has applied stereotype- Parameters:
element
- element to checkstereotypeName
- stereotype name to checkprofileName
- profile name where reside the stereotype- Returns:
- true if element has applied stereotype with given name
- Throws:
IllegalArgumentException
- if element or stereotype or profileName is null
-
addStereotypeByString
@Deprecated public static void addStereotypeByString(Element element, String stereotype) throws IllegalArgumentException Deprecated.Applies stereotype on element by name. The default tag values are not created, to create these values useTagsHelper.createDefaultValues(Element, Stereotype, boolean)
.- Parameters:
element
- elementstereotype
- name of stereotype to apply- Throws:
IllegalArgumentException
- if element or stereotype is null
-
addStereotypeByString
@Deprecated public static void addStereotypeByString(Element element, String stereotype, String profileName) throws IllegalArgumentException Deprecated.Applies stereotype on element by name. The default tag values are not created, to create these values useTagsHelper.createDefaultValues(Element, Stereotype, boolean)
.- Parameters:
element
- elementstereotype
- name of stereotype to applyprofileName
- name of profile where reside the stereotype- Throws:
IllegalArgumentException
- if element or stereotype pr profileName is null
-
addStereotypesWithNames
@Deprecated public static void addStereotypesWithNames(Element element, @CheckForNull Collection<String> stereotypesNames) Deprecated.Applies stereotypes for specified element. The default tag values are created for tags with multiplicity lower bound >=1.- Parameters:
element
- element on which stereotypes are appliedstereotypesNames
- stereotype names, collection of String objects
-
removeStereotypeByString
@Deprecated public static void removeStereotypeByString(Element element, String stereotype) throws IllegalArgumentException Deprecated.Removes applied stereotype from given element.- Parameters:
element
- elementstereotype
- name of stereotype to remove- Throws:
IllegalArgumentException
- if element or stereotype is null
-
hasStereotype
Deprecated.Checks if element has applied stereotype with given name.- Parameters:
element
- element to checkstereotype
- stereotype name to check- Returns:
- true if element has applied stereotype with given name
-
getStereotype
@Deprecated @CheckForNull public static Stereotype getStereotype(Project project, String stereotypeName) Deprecated.this method returns first found stereotype from the project. It is better to narrow down the search with profile, useStereotypesHelper.getStereotype(Project project, String stereotypeName, Profile profile)
Returns stereotype for given name- Parameters:
project
- projectstereotypeName
- name of stereotype- Returns:
- found stereotype or null
-
getStereotype
@Deprecated @CheckForNull public static Stereotype getStereotype(@CheckForNull Project project, String stereotypeName, String profileName) Deprecated.this method is not suitable when project contains more than one profile with same name but different URI. UseStereotypesHelper.getStereotype(Project project, String stereotypeName, Profile profile)
Returns stereotype for given name- Parameters:
project
- project to search for a stereotypestereotypeName
- name of stereotypeprofileName
- profile name- Returns:
- found stereotype or null
-
hasStereotypeOrDerived
Deprecated.Checks if element has assigned given stereotype or derived stereotype from given.- Parameters:
element
- elementstereotypeName
- name of stereotype- Returns:
- boolean true if element is stereotyped by given stereotype
-
isElementStereotypedBy
Deprecated.Checks if element has assigned given stereotype or derived stereotype from given.- Parameters:
element
- elementstereotypeName
- name of stereotype- Returns:
- boolean true if element is stereotyped by given stereotype
-
getStereotypePropertyValue
@Deprecated public static List getStereotypePropertyValue(Element element, @CheckForNull Stereotype stereotype, Property tagDefinition) Deprecated.Gets tagged values as list.- Parameters:
element
- element with applied stereotypestereotype
- stereotypetagDefinition
- tag definition- Returns:
- values
-
getStereotypePropertyValue
@Deprecated public static List getStereotypePropertyValue(Element element, @CheckForNull Stereotype stereotype, Property tagDefinition, boolean calculateDerived) Gets tagged values as list.- Parameters:
element
- element with applied stereotypestereotype
- stereotype not used parameter - left here for compatibilitytagDefinition
- propertycalculateDerived
- if to calculate derived property value- Returns:
- values
-
getExtendedElementsIncludingDerived
@Deprecated public static Collection<Element> getExtendedElementsIncludingDerived(@CheckForNull Stereotype stereotype) Deprecated.useStereotypesHelper.getStereotypedElementsIncludingDerived(Stereotype)
as it has better naming of the methodReturns all elements stereotyped by stereotype and by stereotypes derived from this stereotype.- Parameters:
stereotype
- stereotype- Returns:
- collection of elements stereotyped by stereotype
-
getExtendedElements
Deprecated.useStereotypesHelper.getStereotypedElements(Stereotype)
as it has better naming of the methodReturns all elements stereotyped by stereotype- Parameters:
stereotype
- stereotype- Returns:
- list of elements stereotyped by stereotype
-
hasExtendedElements
Deprecated.useStereotypesHelper.hasStereotypedElements(Stereotype)
as it has better naming of the methodChecks if stereotype has stereotyped elements- Parameters:
stereotype
- stereotype to check- Returns:
- true if stereotype has stereotyped elements
-
MagicDrawProfile.InvisibleStereotypeStereotype.STEREOTYPE_NAME