Freiza Grandmaster Cheater
Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Fri Nov 08, 2013 12:38 pm Post subject: how to call getters of object returned by a getter? (Java) |
|
|
How to call getters of object returned by a getter?
example:
| Code: | public void recurse()
{
Method[] ifcMethod = ifcp.getMethods();
for (Method m : ifcMethod)
{
if (isGetter(m))
{
System.out.println(m.getName());
System.out.println(m.getReturnType());
}
}
} |
If m.getReturnType is an object then I want to call their getter, and if it again returns an object then call their getter too? (I have my stopping condition)
I am unable to get object for invoking of children getters.
I do not want to create newinstance of object. I want to achieve it with existing object.
_________________
|
|