In JXPath I have a class that extends Collection and I am trying to grab
data from it, ignoring that it happens to be a collection. Unless I am
missing something, JXPath appears to only allow you to work with a
Collection's contents, not the collection itself, so I was hoping there
was some simple way around this.

 

For example, here's a class:

 

public class Bar {

            public String getX() { return "xValue" }

}

 

If I do:

JXPathContext jxContext = JXPathContext.newContext(new Bar());

jxContext.setLenient(true);

System.out.println(jxContext.getValue("x));

 

I get "xValue" printed to the console.  However, if my class is:

 

public class Bar extends ArrayList {

            public String getX() { return "xValue" }

}

 

And I do the above code, null is printed to the console. Is there a way
I can get at the X property?

 

Thanks,

Jerry

Reply via email to