computeDocumentationFrom property

List<ModelElement> computeDocumentationFrom

Returns the ModelElement(s) from which we will get documentation. Can be more than one if this is a Field composing documentation from multiple Accessors.

This getter will walk up the inheritance hierarchy to find docs, if the current class doesn't have docs for this element.

Implementation

List<ModelElement> get computeDocumentationFrom {
  if (documentationComment == null &&
      _canOverride &&
      this is Inheritable &&
      (this as Inheritable).overriddenElement != null) {
    return (this as Inheritable).overriddenElement.documentationFrom;
  } else if (this is Inheritable && (this as Inheritable).isInherited) {
    var thisInheritable = (this as Inheritable);
    var fromThis = ModelElement.fromElement(
        element, thisInheritable.definingEnclosingContainer.packageGraph);
    return fromThis.documentationFrom;
  } else {
    return [this];
  }
}