• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

BeanUtilsBean from Apache Commons - member variable

 
Sam Gehouse
Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Documentation says:

org.apache.commons.beanutils.BeanUtilsBean

public Map describe(Object bean)


Return the entire set of properties for which the specified bean provides a read method. This map contains the to String converted property values for all properties for which a read method is provided (i.e. where the getReadMethod() returns non-null).

My question:
What if a private member variable of an Object instance gets populated by constructor? If that private member variable of the Object instance did not have a public getter method defined in the Object, then that private member variable will not ne returned in the Map from describe.

Is my statemement for the API correct?

I wanted to ask the question above to make sure that I am reading the documentation correct.

Will appreciate any comments.
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CarefullyChooseOneForum while posting.
Moving to Other open source projects.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sam Gehouse wrote:Documentation says:

My question:
What if a private member variable of an Object instance gets populated by constructor? If that private member variable of the Object instance did not have a public getter method defined in the Object, then that private member variable will not ne returned in the Map from describe.

Is my statement for the API correct?

Will appreciate any comments.


I believe you are correct yes. I assume you're deliberately wanting to keep this value hidden?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic