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 1070947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:38:39+00:00 2026-05-16T20:38:39+00:00

I have huge object, I have its class of course, I’m extracting some values

  • 0

I have huge object, I have its class of course, I’m extracting some values from it, but since it is really big I don’t know in which list or where the value I’m looking for is.

Is there a way to create some kind of object breakdown routing and search every part for the value I’m expecting, and it is hidden somewhere in the object, I just can’t find it in Eclipse; it’s too nested.

I thought of using reflection to go through all fields of object class and search for the value inside of each field (fields inside lists (list of lists etc)). Any other ideas?

  • 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-05-16T20:38:39+00:00Added an answer on May 16, 2026 at 8:38 pm

    I assume you just want to find a specific value and to trace its source. And all this, you want to do at debug time. I would suggest two options.

    Option1
    Use JSON – Serialize the object to json string and do a manual text search on the result. You would neeed json.jar (or any other parser) for this.

        try {
           System.out.println(new JSONObject(new YourHugeObject()).toString(5));
        } catch (JSONException e) {
          log(e);
        }
    

    Which will produce something like this. (I have simulated this by creating an object with some nested fields,lists,maps)

    {
     "ct": {
          "a": 1,
          "b": "sdf",
          "f": 12,
          "nested": {
               "key1": {
                    "kk": "kk",
                    "ssdf": 123
               },
               "onemorekey": {
                    "kk": "kk",
                    "ssdf": 123
               }
          }
     },
     "doubleProp": 12.2,
     "lngprop": 1232323,
     "strProp": "123",
     "stringlist": [
          "String1",
          "String2",
          "String3"
     ]
    }
    

    Option2
    Convert/Serialize the object to XML. Use XStream for this,which will be the easiest of all available parsers. With just two lines of code,

        XStream stream = new XStream();
        System.out.println(stream.toXML(new YourHugeObject()));
    

    Which will produce,

    <com.kmg.jsontools.test.JSTest>
    <stringlist>
     <string>String1</string>
     <string>String2</string>
     <string>String3</string>
    </stringlist>
    <strProp>123</strProp>
    <doubleProp>12.2</doubleProp>
    <lngprop>1232323</lngprop>
    <ct>
     <a>1</a>
     <b>sdf</b>
     <f>12.0</f>
     <nested>
       <entry>
         <string>key1</string>
         <com.kmg.jsontools.test.Type1>
           <kk>kk</kk>
           <ssdf>123</ssdf>
         </com.kmg.jsontools.test.Type1>
       </entry>
       <entry>
         <string>onemorekey</string>
         <com.kmg.jsontools.test.Type1>
           <kk>kk</kk>
           <ssdf>123</ssdf>
         </com.kmg.jsontools.test.Type1>
       </entry>
     </nested>
    </ct>
    </com.kmg.jsontools.test.JSTest>
    

    Either of the above approaches,you can either print the result to the console or to a file and inspect it manually.
    Alternatively you can also use reflection,in which case you would have to write a lot of code and significant amount of time in testing it as well.

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

Sidebar

Related Questions

I have a class that requires some of its methods to be called in
I have a huge database with some 100 tables and some 250 stored procedures.
I have a huge dictionary of blank values in a variable called current like
i have a input tag which is non editable, but some times i need
I want to know whether the object that would be created from a class
Let's assume I have some MyObject obj object and want to access a property
I have huge 3D arrays of numbers in my .NET application. I need to
I have huge number of Word files I need to merge (join) into one
I have a huge web app that is having issues with memory leak in
I have a huge file, where I have to insert certain characters at a

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.