• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Nested Object in Reflection API

 
Ranch Hand
Posts: 230
IntelliJ IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All

Reflection API Question

I have collected Fields using for a Bean. As I do have a nested Bean so can anyone suggest me as how to read the nested Objects

I want to iterate through all the fields of a bean

e.g Bean Structure
Family
  Father
      his him half
  Mother
     her hers
  Child
    so  all of

Family has a father. Father can also have nested objects like his him half
                                  Mother can also have nested objects  like her hers
                                  Child can also have nested objects like  so all of

Thanks in Advance
 
Saloon Keeper
Posts: 15529
364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why reflection? You can just access the properties directly, can't you?

You probably want to write some sort of recursive algorithm that retrieves whatever information you're looking for.

What information do you want to get out of the tree? Have you written a recursive algorithm before?
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic