JXPath is a java library for Object Graph Navigation using the XPath syntax.
This requires the libraries commons-jxpath-1.3.jar, commons-beanutils.jar and commons-logging.jar to be in classpath.
The following example shows how to iterate node Pointers in JXPath.
/**
* @param args
*/ public static void main(String[] args) {
BookStore bookStore = new BookStore(
Arrays.asList( new Book("A-Book1", 11.11, new Author("A")), new Book("B-Book1", 22.22, new Author("B")), new Book("B-Book2", 33.33, new Author("B")), new Book("C-Book1", 33.33, new Author("C")), new Book("C-Book2", 16.66, new Author("C")), new Book("C-Book3", 48.12, new Author("C")), new Book("D-Book1", 44.44, new Author("D"))
)
);
//Create JXPathContext with BookStore instance as ROOT node
JXPathContext context = JXPathContext.newContext(bookStore);
//Get all book titles by author 'C'
Iterator<?> bookNamesByCPointer = context.iteratePointers("/books/author[name='C']");