Jose
Jose

Reputation: 49

Collecting Java class information

Is there any way to collect the information of a Java Class through a plugin?

I wanted to collect information such as the package it belongs, the imports it has, if it has implements or extends.

After collecting necessary information the intend is to copy it to a text field.

Upvotes: 1

Views: 118

Answers (2)

Unni Kris
Unni Kris

Reputation: 3095

You can collect the information of all the files belonging to a Java project using the Eclipse JDT plugin. You may use the Eclipse's AST parser also in combination.

The JDT Core component is the plug-in that defines the core Java elements and API. This Core component can be included inside our own plugin and can be used to search, compile and manipulate Java code outside an IDE.

You can find a start-up tutorial from here.

Upvotes: 1

Mikhail Vladimirov
Mikhail Vladimirov

Reputation: 13890

You can use ASM library to parse class file and extract any information from it.

Upvotes: 1

Related Questions