Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7999139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:25:00+00:00 2026-06-04T15:25:00+00:00

I am playing with the Doclets, and I am running into the next problem.

  • 0

I am playing with the Doclets, and I am running into the next problem. I want to get the attributes from a class, and I thought the parameter method would help. My code looks like the next one(I am doing that for the return type of a method):

        ClassDoc retType = pMethod.returnType().asClassDoc();
        if(retType == null) {
            System.out.println("No returnType for method " + pMethod.name());
            return false;
        } else {
            System.out.println("returnType for method " 
+ pMethod.name() + " is from type " + pMethod.returnType().typeName());
            }
            FieldDoc[] fields = retType.fields();
            System.out.println("fields length for type " + 
retType.name() + "  is " + fields.length);

What I am getting is

returnType for method myMethod is from type
MyMethodResponse

fields length for type MyMethodResponse is 0

Maybe I am missing something. Would not the ClassDoc.fields() method bring me all the list of attributes? Is there any way to do that? Thank you very much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:25:01+00:00Added an answer on June 4, 2026 at 3:25 pm

    Ok, searching on the web, I have not found a lot of explanations/examples. There is one web page: use doclet to extract class, field, method information from java source code in which, in order to extract the attributes, they use the ClassDoc.fields() method in the next way:

    FieldDoc[] fields=classDoc.fields(false);
    

    Using that in that way, I get all the attributes that I wanted, because I am disabling the access modifier filter that comes enabled by default.
    In the API, that boolean parameter from the fields method, is used to use enable/dissable the access modifier filter declared while calling javaDoc (-public, -protected, -package, and -private). So if we just want to get all attributes from that class, we need to disable it setting it to false.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Playing around a bit more with jqTouch and am running into a problem with
Playing with the new(ish) url rewriting functionality for web forms, but I'm running into
Im playing with my smart pointer class and I want to implement ++ and
Still playing with Chrome Extension and have a little problem when I want to
Playing with jquery for the first time, and I'm trying to get a simple
been playing around with ResolveClientUrl(~/Confirmation.aspx) and other methods.. I am tryin go get the
Im playing a little bit with heavy-client app. Imagine I have this model: class
iam playing around with OPEN CV from Intel with the associated PHP Extensions. Works
Playing with URLs, more specifically building them incrementally from other, discovered URLs. In doing
been playing around with Capistrano to get an automated deploy between my server and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.