Can JXPath find objects by type?

286 views Asked by At

I have a relatively complicated object graph. Is it possible to have an expression in JXPath that will find any objects by type?

For example:

List<ThingToFind> myList = JXPathContext.newContext(rootObject).getValue(??objects of type ThingToFind??)

The List would then contain objects located at the paths:

/rootObject/foo/bar/instanceOfThingToFind
/rootObject/some/long/path/anotherInstanceOfThingToFind
1

There are 1 answers

0
Mr_Thorynque On

I want to do the same, I don't test it but you can try some this :

//class[@name='classname']/..