J
Jason Cavett
Here is what I'm trying to do in code...
public DataModel getParentType(DataModel child, Class classType) {
DataModel retVal = null;
if (child instanceof classType) {
retVal = child;
} else {
this.getParentType(child, classType);
}
return retVal;
}
Basically, I'm trying to see if an item in a tree has a parent of type
Class.
I want to be able to test against whatever classType is passed in.
However, I'm not sure how to do this and I haven't been able to find
anything in my searches for how to make something like this work. Any
help is appreciated.
Thanks
public DataModel getParentType(DataModel child, Class classType) {
DataModel retVal = null;
if (child instanceof classType) {
retVal = child;
} else {
this.getParentType(child, classType);
}
return retVal;
}
Basically, I'm trying to see if an item in a tree has a parent of type
Class.
I want to be able to test against whatever classType is passed in.
However, I'm not sure how to do this and I haven't been able to find
anything in my searches for how to make something like this work. Any
help is appreciated.
Thanks