Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Sxtanna/java-doctor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java-doctor

A utility for reading JavaDocs from a URL in a pseudo-high level fashion.


Example from JavaDoctorExample

final String url = "https://papermc.io/javadocs/paper/1.15/index-all.html";
// usages of the make function allow the application to continue in the current context without interruption due to IO
try (final JavaDoctor doctor = JavaDoctor.make(new URL(url)))
{
	doctor.fetch();
	final Optional<JavaDoctorObject> type = doctor.findType("Barrel");
	final Optional<JavaDoctorObject> desc = doctor.findDesc(type);
	System.out.println("Description of Barrel Interface: " + desc.flatMap(JavaDoctorObject::text).orElse("Unknown"));
}
catch (Exception ex)
{
	ex.printStackTrace();
}

// usages of the exam function cause the doctor to immediately fetch the html document
// benefits being that by the time the context continues, the doctor can be used directly.
try (final JavaDoctor doctor = JavaDoctor.exam(new URL(url)))
{
	final Optional<JavaDoctorObject> type = doctor.findType("BatToggleSleepEvent");
	final Optional<JavaDoctorObject> desc = doctor.findDesc(type);
	System.out.println("Description of BatToggleSleepEvent Class: " + desc.flatMap(JavaDoctorObject::text).orElse("Unknown"));
}
catch (Exception ex)
{
	ex.printStackTrace();
}

About

A utility for reading JavaDocs from a URL in a pseudo-high level fashion.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages