Class ElementHelper


  • @OpenApiAll
    public class ElementHelper
    extends java.lang.Object
    This class provides the function to help the report in order to handle elements.
    Since:
    June 26, 2007
    • Constructor Summary

      Constructors 
      Constructor Description
      ElementHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean containsStereotype​(Element element, java.lang.String stereotypeName)
      Returns true if element contains a stereotype for the specified stereotype name.
      static java.lang.String getElementType​(BaseElement element)
      Return type of element in all lower case format.
      static java.lang.String getMetaClassName​(Element element)
      Return meta class name.
      static java.lang.String getPathVariable​(java.lang.String name)
      It is used for getting path variable by using variable name.
      static java.lang.Object getProperty​(Element element, java.lang.String propertyName)
      Get the property for custom tags that are not included in Open API.
      static java.lang.String getSortKey​(BaseElement input)
      It is use for getting SortKey.
      static boolean hasProperty​(Element element, java.lang.String propertyName)
      Returns true when a property with a given name is specified on this element, false otherwise.
      static java.lang.String resolveFileNameVariable​(java.lang.String content, com.nomagic.magicdraw.magicreport.ui.bean.ReportBean reportBean)
      Used for resolving the variable in output report file name in to value.
      static java.lang.String resolvePathVariable​(java.lang.String content)
      It is used for resolving the path variable into the real path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ElementHelper

        public ElementHelper()
    • Method Detail

      • getSortKey

        public static java.lang.String getSortKey​(BaseElement input)
        It is use for getting SortKey.
        Parameters:
        input - BaseElement.
        Returns:
        string
      • getPathVariable

        public static java.lang.String getPathVariable​(java.lang.String name)
        It is used for getting path variable by using variable name.
        Parameters:
        name - that variable name
        Returns:
        the path
      • resolvePathVariable

        public static java.lang.String resolvePathVariable​(java.lang.String content)
        It is used for resolving the path variable into the real path.
        Parameters:
        content - the content that includes the path variable
        Returns:
        the content that are resolved into the real path.
      • resolveFileNameVariable

        public static java.lang.String resolveFileNameVariable​(java.lang.String content,
                                                               com.nomagic.magicdraw.magicreport.ui.bean.ReportBean reportBean)
        Used for resolving the variable in output report file name in to value.
        Parameters:
        content - the content that includes the variable.
        reportBean - reportBean object
        Returns:
        the content that are resolved into real value.
      • hasProperty

        public static boolean hasProperty​(Element element,
                                          java.lang.String propertyName)
        Returns true when a property with a given name is specified on this element, false otherwise.
        Parameters:
        element - element to test
        propertyName - property name
        Returns:
        true when a property with a given name is specified on this element, false otherwise.
      • getProperty

        public static java.lang.Object getProperty​(Element element,
                                                   java.lang.String propertyName)
                                            throws com.nomagic.magicdraw.magicreport.helper.PropertyNotFoundException
        Get the property for custom tags that are not included in Open API.
        Parameters:
        element - the object that will be gotten that data.
        propertyName - the field of the element.
        Returns:
        the data of that field in the element.
        Throws:
        com.nomagic.magicdraw.magicreport.helper.PropertyNotFoundException - when a request property name is not found on target element.
      • getMetaClassName

        public static java.lang.String getMetaClassName​(Element element)
        Return meta class name.
        Parameters:
        element - element
        Returns:
        meta class name
      • getElementType

        public static java.lang.String getElementType​(BaseElement element)
        Return type of element in all lower case format.
        Parameters:
        element - MagicDraw base element
        Returns:
        element type
      • containsStereotype

        public static boolean containsStereotype​(Element element,
                                                 java.lang.String stereotypeName)
        Returns true if element contains a stereotype for the specified stereotype name.
        Parameters:
        element - element to test
        stereotypeName - stereotype name to be tested
        Returns:
        true if element contains a stereotype for the specified stereotype name.