All Downloads are FREE. Search and download functionalities are using the official Maven repository.

flatgraph.help.DocFinder.scala Maven / Gradle / Ivy

There is a newer version: 0.0.91
Show newest version
package flatgraph.help

object DocFinder {
  def findDocumentedMethodsOf(clazz: Class[?]): Iterable[StepDoc] = {
    clazz.getMethods.flatMap { method =>
      method.getAnnotations.find(_.isInstanceOf[Doc]).map { case docAnnotation: Doc =>
        StepDoc(
          clazz.getName,
          method.getName,
          StrippedDoc(docAnnotation.info, docAnnotation.longInfo.stripMargin, docAnnotation.example.stripMargin)
        )
      }
    }
  }

  case class StepDoc(traversalClassName: String, methodName: String, doc: StrippedDoc)
  case class StrippedDoc(info: String, longInfo: String, example: String)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy