Class DeprecatedStereotypesHelper

  • Direct Known Subclasses:
    TagsHelper

    @OpenApiAll
    public class DeprecatedStereotypesHelper
    extends DeprecatedTagsHelper
    Utility class to work with stereotypes. It has only deprecated methods for API compatibility.
    • Constructor Detail

      • DeprecatedStereotypesHelper

        public DeprecatedStereotypesHelper()
    • Method Detail

      • hasStereotype

        @Deprecated
        public static boolean hasStereotype​(Element element,
                                            java.lang.String stereotypeName,
                                            java.lang.String profileName)
                                     throws java.lang.IllegalArgumentException
        Deprecated.
        this method is not suitable when project contains more than one profile with same name but different URI. Use StereotypesHelper.hasStereotype(Element, Stereotype)
        Checks if element has applied stereotype
        Parameters:
        element - element to check
        stereotypeName - stereotype name to check
        profileName - profile name where reside the stereotype
        Returns:
        true if element has applied stereotype with given name
        Throws:
        java.lang.IllegalArgumentException - if element or stereotype or profileName is null
      • addStereotypeByString

        @Deprecated
        public static void addStereotypeByString​(Element element,
                                                 java.lang.String stereotype,
                                                 java.lang.String profileName)
                                          throws java.lang.IllegalArgumentException
        Applies stereotype on element by name. The default tag values are not created, to create these values use TagsHelper.createDefaultValues(Element, Stereotype, boolean).
        Parameters:
        element - element
        stereotype - name of stereotype to apply
        profileName - name of profile where reside the stereotype
        Throws:
        java.lang.IllegalArgumentException - if element or stereotype pr profileName is null
      • addStereotypesWithNames

        @Deprecated
        public static void addStereotypesWithNames​(Element element,
                                                   @CheckForNull
                                                   java.util.Collection<java.lang.String> stereotypesNames)
        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 applied
        stereotypesNames - stereotype names, collection of String objects
      • removeStereotypeByString

        @Deprecated
        public static void removeStereotypeByString​(Element element,
                                                    java.lang.String stereotype)
                                             throws java.lang.IllegalArgumentException
        Removes applied stereotype from given element.
        Parameters:
        element - element
        stereotype - name of stereotype to remove
        Throws:
        java.lang.IllegalArgumentException - if element or stereotype is null
      • hasStereotype

        @Deprecated
        public static boolean hasStereotype​(Element element,
                                            java.lang.String stereotype)
        Checks if element has applied stereotype with given name.
        Parameters:
        element - element to check
        stereotype - stereotype name to check
        Returns:
        true if element has applied stereotype with given name
      • getStereotype

        @Deprecated
        @CheckForNull
        public static Stereotype getStereotype​(Project project,
                                               java.lang.String stereotypeName)
        Deprecated.
        this method returns first found stereotype from the project. It is better to narrow down the search with profile, use StereotypesHelper.getStereotype(Project project, String stereotypeName, Profile profile)
        Returns stereotype for given name
        Parameters:
        project - project
        stereotypeName - name of stereotype
        Returns:
        found stereotype or null
      • getStereotype

        @Deprecated
        @CheckForNull
        public static Stereotype getStereotype​(@CheckForNull
                                               Project project,
                                               java.lang.String stereotypeName,
                                               java.lang.String profileName)
        Deprecated.
        this method is not suitable when project contains more than one profile with same name but different URI. Use StereotypesHelper.getStereotype(Project project, String stereotypeName, Profile profile)
        Returns stereotype for given name
        Parameters:
        project - project to search for a stereotype
        stereotypeName - name of stereotype
        profileName - profile name
        Returns:
        found stereotype or null
      • hasStereotypeOrDerived

        @Deprecated
        public static boolean hasStereotypeOrDerived​(Element element,
                                                     java.lang.String stereotypeName)
        Checks if element has assigned given stereotype or derived stereotype from given.
        Parameters:
        element - element
        stereotypeName - name of stereotype
        Returns:
        boolean true if element is stereotyped by given stereotype
      • isElementStereotypedBy

        @Deprecated
        public static boolean isElementStereotypedBy​(Element element,
                                                     java.lang.String stereotypeName)
        Checks if element has assigned given stereotype or derived stereotype from given.
        Parameters:
        element - element
        stereotypeName - name of stereotype
        Returns:
        boolean true if element is stereotyped by given stereotype
      • getStereotypePropertyValue

        @Deprecated
        public static java.util.List getStereotypePropertyValue​(Element element,
                                                                @CheckForNull
                                                                Stereotype stereotype,
                                                                Property tagDefinition)
        Gets tagged values as list.
        Parameters:
        element - element with applied stereotype
        stereotype - stereotype
        tagDefinition - tag definition
        Returns:
        values
      • getStereotypePropertyValue

        @Deprecated
        public static java.util.List getStereotypePropertyValue​(Element element,
                                                                @CheckForNull
                                                                Stereotype stereotype,
                                                                Property tagDefinition,
                                                                boolean calculateDerived)
        Gets tagged values as list.
        Parameters:
        element - element with applied stereotype
        stereotype - stereotype not used parameter - left here for compatibility
        tagDefinition - property
        calculateDerived - if to calculate derived property value
        Returns:
        values
      • getExtendedElementsIncludingDerived

        @Deprecated
        public static java.util.Collection<Element> getExtendedElementsIncludingDerived​(@CheckForNull
                                                                                        Stereotype stereotype)
        Deprecated.
        Returns all elements stereotyped by stereotype and by stereotypes derived from this stereotype.
        Parameters:
        stereotype - stereotype
        Returns:
        collection of elements stereotyped by stereotype
      • getExtendedElements

        @Deprecated
        public static java.util.List<Element> getExtendedElements​(@CheckForNull
                                                                  Stereotype stereotype)
        Deprecated.
        use StereotypesHelper.getStereotypedElements(Stereotype) as it has better naming of the method
        Returns all elements stereotyped by stereotype
        Parameters:
        stereotype - stereotype
        Returns:
        list of elements stereotyped by stereotype
      • hasExtendedElements

        @Deprecated
        public static boolean hasExtendedElements​(Stereotype stereotype)
        Deprecated.
        use StereotypesHelper.hasStereotypedElements(Stereotype) as it has better naming of the method
        Checks if stereotype has stereotyped elements
        Parameters:
        stereotype - stereotype to check
        Returns:
        true if stereotype has stereotyped elements