Get property of parent node
KammererTob opened this issue · 2 comments
KammererTob commented
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?
KammererTob commented
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()
KammererTob commented
Think i already solved it on my own. Object parentObj = node.getParentNode().get(this.instance);
Pretty easy. Sorry for the inconvenience