SQiShER/java-object-diff

Get property of parent node

KammererTob opened this issue · 2 comments

Hi,

Thanks for this very useful library!
I have one question: Is it possible to get arbitrary property values from nodes? For Example:

abstract class A {
 getId();
}

class B extends A {
 int currentValue;
}

class C extends A {
 B b;
}

We compare two C objects and the current node property is currentValue of class B.
Is there a way to do something like this: ((A)node.getParentNode().getObject()).getId();? So traverse up until we have a class which extends A and then access the ID of this object?

Sorry about the opening and closing. Thought i had solved it, but i only can access the id of the root node by using this.target.getId()

Think i already solved it on my own. Object parentObj = node.getParentNode().get(this.instance);
Pretty easy. Sorry for the inconvenience