Class ElementHelper

java.lang.Object
com.nomagic.magicdraw.magicreport.helper.ElementHelper

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

    • ElementHelper

      public ElementHelper()
  • Method Details

    • getSortKey

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

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

      public static String resolvePathVariable(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 String resolveFileNameVariable(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, 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 Object getProperty(Element element, 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 String getMetaClassName(Element element)
      Return meta class name.
      Parameters:
      element - element
      Returns:
      meta class name
    • getElementType

      public static 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, 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.