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

overflowdb.traversal.help.DocFinder.scala Maven / Gradle / Ivy

There is a newer version: 1.193
Show newest version
package overflowdb.traversal.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