commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Schlipf <carsten.schl...@yeap.de>
Subject Re: JXPath and Custom Graphs
Date Mon, 17 Nov 2008 15:50:22 GMT
If I understand you right, a JXPathBeanInfo implementation for you 
classes will solve this problem for you:

http://commons.apache.org/jxpath/apidocs/org/apache/commons/jxpath/JXPathBeanInfo.html

This allows to map property names to arbitrary functions in your pojo as 
well as hiding properties that shall not be exposed.

Regards,
Carsten

Andrew Hughes wrote:
> Hi All,
> We've got an existing 'graph' of dynamic pojo's. This is effectively a root
> node, with sibling child node(S), and inturn they have child node(s) (so
> your typical tree/graph). Ideally we would like to run xpath
> expression/evalution on our dynamic graph. The objects we're storing do not
> meet the beans or dyna beans standard. I know there are a few options here
> and to be quite honest I'm not sure which option is the best.
>
> I believe my options are to wrap/store the existing pojo's inside a
> bean/dynabean standard wrapping pojo's. Alternatively, I can do some work
> that will provide JXPath with the ability to traverse our current 'graph'
> and hence evaluate XPath expressions. I would much prefer the second option
> (if possible).
>
> Finally there's the gotcha. As our 'graph' is dynamic and just as nodes are
> created at runtime they are also destroyed and it would be nice to have
> JXPath as an observer (not maintainer) of the graph.
>
> Any advice/help would be much appreciated :)
>
> Thanks,
> Andrew
>
>   

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message