Chiranjivi Vijay

Greenhorn
+ Follow
since Jan 15, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chiranjivi Vijay

Hi All

I am working on one project where I am using the JDIC jars and I am getting the following exception when I try to use WebBrowser API of jdic.

java.lang.NullPointerException
at org.jdesktop.jdic.browser.WebBrowser.<init>(Unknown Source)
at org.jdesktop.jdic.browser.WebBrowser.<init>(Unknown Source)
at org.jdesktop.jdic.browser.WebBrowser.<init>(Unknown Source)

I have set JDIC path in the environment variables as well. I researched internet and dint get possible solutions. Please let me know if you guys need additional info I will let you know.

Thanks
Vijay
8 years ago
Hi Ireneusz

Thank you for your instant reply.

Based on what you said



I believe its exactly the same in my code(second way of accessing) as well right. But here I am getting an exception. and couldn't retrieve the data.

I will explain one possible scenario and please let me know whether we could use reflection or not.

Say the Manager class has been loaded into the JVM and our Test program class has to access it. Here, all we have is instance of Manager class and in this situation how can we access the private variables map1 and map2 from Lead class. Which means we don't have access to create a new instance of Lead class because if we do then the values that are present already in map1 and map2 will be lost as we will be getting a new map1 and map2 instances causing loss of data.

Please let me know if it is not clear. I will try to explain in detail.

Thanks
Vijay


8 years ago
Hi Rob

I got what you meant but my concern here is since the inner class Lead is private static how can I pass the instance of that class which I can't access from outside. Could you please help me out how to access the variable map1 and map2 by passing the instance of class Lead?

Thanks
Vijay
8 years ago
Hi Ireneusz

I understand that the variables declared are not static. I was wondering how to use reflection technique for accessing the variables map1 and map2 declared in the inner class Lead. I am not sure how to get those fields. I have tried based on the code what I have mentioned before.

Thanks
Vijay

8 years ago
Hi Everyone

I have a question in Java reflection usage. Could anyone help me out how we can access the variables map1, map2 using reflection from the following code




I tried the reflection technique by doing the following




When I tried the above code and debugged the code in eclipse I could see that the Field contain the necessary data but I couldn't retrieve the value from the Field object as my instance refers to Manager for the the get method I believe. Can anyone tell me what exactly has to be done to get the value for map1 and map2.

Thanks
Vijay
8 years ago