2

I am new to the expressions language, and I want to learn more about org.apache.commons.jxpath utilities. But I am wondering about the implementation of the JXPath utilities. Is the object first marshaled, upon which XPath searching will be applied, or does the object keep its original state i.e. without marshaling it?

Kindly provide some good reference code snippet if possible.

Thanks.

dda
  • 6,030
  • 2
  • 25
  • 34
Zubair Ahmed
  • 147
  • 4
  • 13

1 Answers1

1

I would perhaps check out the source code. I don't quite understand what you mean when you refer to 'marshalling'. The object won't be serialised, but I would instead expect some simple reflection to discover the object's properties.

The source for ValueUtils.java appears to have a lot of reflection code for the object's properties.

Brian Agnew
  • 268,207
  • 37
  • 334
  • 440
  • Thanks for prompt response Brian. Actually I used XPath before, in which objects first transformed into XML Document (i.e. marshall) and then apply the XPath expressions to search the particual value. Thats what I am worried about in jxpath behavior... – Zubair Ahmed Dec 03 '12 at 14:43
  • JXPath works directly on POJOs (standard Java objects). It doesn't marshall to XML at all – Brian Agnew Dec 03 '12 at 15:23
  • Thanks for the response Brian, can you provide any sample code for this Utility? – Zubair Ahmed Dec 04 '12 at 11:47