Class Documentation

java.lang.Object
org.faktorips.runtime.model.type.Documentation

public class Documentation extends Object
Utility class for handling documentation of model elements.
  • Field Details

    • INHERIT_DESCRIPTION_TAG

      public static final String INHERIT_DESCRIPTION_TAG
      This tag, if included in an element's description, is replaced by the description of the super-element overwritten by the element.
      See Also:
  • Method Details

    • of

      public static <E extends ModelElement> String of(E element, DocumentationKind type, Locale locale, String fallback, Supplier<Optional<? extends E>> superElementGetter)
      Returns the documentation of the given type for the given model element in the given locale. If the documentation is empty and the element has a super-element(provided via the super-element getter) it overwrites, that super-element's documentation is retrieved instead.

      Should the documentation contain the tag "{inheritDesc}", the super-element's documentation is inserted in this element's documentation, replacing that tag.

      In the case that the documentation is still empty and the element is not a TypePart, the given fallback value is returned.

      Type Parameters:
      E - the model element's type, to make sure the super-element getter matches the type
      Parameters:
      element - the documented element
      type - the documentation type
      locale - the desired locale
      fallback - the text to be returned when no documentation is found
      superElementGetter - provides access to the element's super-element if necessary