Class ModelElement

    • Method Detail

      • getName

        public java.lang.String getName()
        Returns:
        the qualified IPS object name
      • getLabel

        public java.lang.String getLabel​(java.util.Locale locale)
        Returns the label for this model element in the specified locale. If there is no label in the specified locale, it tries to find the label in the default locale. If there is also no label in the default locale the element's name is returned.
        Returns:
        the label for the given locale or the element's name if no label exists for the given locale nor in the default locale
      • getDescription

        public java.lang.String getDescription​(java.util.Locale locale)
        Returns the description for this model element in the specified locale. If there is no description in the specified locale, it tries to find the description in the default locale. If there is also no description in the default locale it returns the empty string.
        Returns:
        the description for the given locale or an empty string if no description exists for the given locale
      • getMessageKey

        protected abstract java.lang.String getMessageKey​(DocumentationKind messageType)
      • getDocumentation

        protected java.lang.String getDocumentation​(java.util.Locale locale,
                                                    DocumentationKind type,
                                                    java.lang.String fallback)
      • getMessageHelper

        protected abstract MessagesHelper getMessageHelper()
      • createMessageHelper

        protected MessagesHelper createMessageHelper​(IpsDocumented documentedAnnotation,
                                                     java.lang.ClassLoader classLoader)
      • getExtensionPropertyValue

        public java.lang.Object getExtensionPropertyValue​(java.lang.String propertyId)
        Returns the value for the given extension property identified by the specified id.

        Note: At the moment only String is supported as extension property value. This method returns Object for future changes.

        Returns:
        the value of the extension property defined by the given propertyId or null if the extension property's isNull attribute is true
        Throws:
        java.lang.IllegalArgumentException - if no such property exists
      • getExtensionPropertyIds

        public java.util.Set<java.lang.String> getExtensionPropertyIds()
        Returns:
        a set of the extension property ids defined for this element
      • invokeMethod

        protected static java.lang.Object invokeMethod​(java.lang.reflect.Method method,
                                                       java.lang.Object source,
                                                       java.lang.Object... arguments)
      • invokeField

        protected static java.lang.Object invokeField​(java.lang.reflect.Field field,
                                                      java.lang.Object source)
      • getRelevantProductObject

        protected static java.lang.Object getRelevantProductObject​(IProductComponent productComponent,
                                                                   java.util.Calendar effectiveDate,
                                                                   boolean changingOverTime)
        If the changingOverTime is false, the given product component is returned. If changing over time is true, the effective date is used to determine the generation to use. If the effective date is null, the latest product component generation is returned.
        Parameters:
        productComponent - the product component to potentially retrieve a generation from
        effectiveDate - the date to select the product component generation. If null the latest generation is used. Is ignored if the model element's configuration is not changing over time.
        changingOverTime - whether the model element is changing over time.
        Returns:
        The given product component or the effective generation, depending on changingOverTime and effectiveDate.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isDeprecated

        public boolean isDeprecated()
      • getDeprecation

        public java.util.Optional<Deprecation> getDeprecation()