Package org.faktorips.runtime.model.type
Class Documentation
java.lang.Object
org.faktorips.runtime.model.type.Documentation
Utility class for handling documentation of model elements.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThis tag, if included in an element's description, is replaced by the description of the super-element overwritten by the element. -
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends ModelElement>
Stringof(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.
-
Field Details
-
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 elementtype- the documentation typelocale- the desired localefallback- the text to be returned when no documentation is foundsuperElementGetter- provides access to the element's super-element if necessary
-