File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes BeanUtilsBean from Apache Commons - member variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "BeanUtilsBean from Apache Commons - member variable" Watch "BeanUtilsBean from Apache Commons - member variable" New topic
Author

BeanUtilsBean from Apache Commons - member variable

Sam Gehouse
Ranch Hand

Joined: Jul 21, 2003
Posts: 281
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

Joined: Feb 25, 2007
Posts: 1638

CarefullyChooseOneForum while posting.
Moving to Other open source projects.


apigee, a better way to API!
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: BeanUtilsBean from Apache Commons - member variable
 
Similar Threads
Some doubts on - Mikalai Zaikin study material
what is the difference?
long post IBM.158
Properties/Settings - a design question
Using Visual Web JavaServerFaces to display db data in a table