A kotlin library, which also supports java, designed to easily parse jenkins javadocs
Make sure to replace VERSION with the version shown above
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.TheForbiddenAi</groupId>
<artifactId>JenkinsParser-Kotlin</artifactId>
<version>VERSION</version>
</dependency>
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.TheForbiddenAi:JenkinsParser-Kotlin:VERSION'
}
First, you must create an instance of Jenkins
val jenkins = Jenkins(url)
- url - The jenkins class list url or tree url (Example URLs: https://docs.oracle.com/en/java/javase/11/docs/api/allclasses.html or https://docs.oracle.com/en/java/javase/13/docs/api/overview-tree.html)
Querying classes, methods, enums, and fields:
val infoList = jenkins.search("String")
val classInfo = jenkins.retrieveClass("String")
val methodInfo = jenkins.retrieveMethod("String", "valueOf")
// If you already have a class information object defined you can use:
val methodInfoWithClass = jenkins.retrieveMethod(classInfo, "valueOf")
// This works for fields and enums as well
val enumInfo = jenkins.retrieveEnum("Component.BaselineResizeBehavior", "center_offset")
val fieldInfo = jenkins.retrieveField("String", "case_insensitive_order")
When searching for multiple classes, or methods, with the same name use:
val classes = jenkins.searchClasses("Object")
val methods = jenkins.searchMethods("String", "valueOf")
// Or you can use the search method
val infoList = jenkins.search("String.valueOf")
When searching for something in a class where you may not know if it is a method, enum, or field use:
val classInfo = jenkins.retrieveClass("String")
val infoList = classInfo.searchAll("valueOf")