Details
-
Type: Improvement
-
Status: Closed
-
Priority: Minor
-
Resolution: Won't Fix
-
Affects Version/s: 2.0
-
Fix Version/s: None
-
Component/s: Java API
-
Labels:None
-
Number of attachments :
Description
Type does have a field name. As far as I understand that would be the Simple Name of the type. There is no getter for that field.
My use case is this:
I do have a java class and want to check if there is an annotation like javax.persistence.Entity. The class file has the import:
import javax.persistence.*;
qdox is thus not able to resolve the fully qualified name, since it does not have access to that sources.
Now I know that the full class name is javax.persistence.Entity, and I assume the class to have no compile errors. So I can check the imports myself. However if I do getValue, it first tries to resolve it which always fails and takes something like 16 ms. Its by far the slowest part (it tries to load the class?) in a performance critical part of my project.
With getSimpleName though I could check the imports myself and save some time.
Activity
Field | Original Value | New Value |
---|---|---|
Status | Open [ 1 ] | Closed [ 6 ] |
Assignee | Robert Scholte [ rfscholte ] | |
Resolution | Won't Fix [ 2 ] |
This means you have to add this jar/dependency to the classLibrary of the JavaDocBuilder. That's by far more solid than trying to resolve it yourself. QDox follows the same strategy as java in resolving the fully qualified name of the class.
I agree we should add more java.lang.Class-methods, but not for the reason you mentioned.