commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeffrey Puro" <jp...@sterlingtesting.com>
Subject RE: JXPath and Collections
Date Thu, 07 Feb 2008 20:18:19 GMT
If I change this to a List, how do I set an element on it or add one to
it?  

context.setValue("myList/", "New object on list");

Do I have to specify a particular index or can setValue just add on its
own?

Thanks,

Jeff

-----Original Message-----
From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
Sent: Wednesday, February 06, 2008 3:55 PM
To: Jakarta Commons Users List
Subject: Re: JXPath and Collections


--- Jeffrey Puro <jpuro@sterlingtesting.com> wrote:

> I have a pojo that has the following properties:
> 

Looks like a set is unsupported.  :(  Could you
possibly use some kind of wrapper object, possibly
returning asList() from a commons-collections
ListOrderedSet from a getSetAsList() method or
something similar?  JXPath can add an element to a
list.

-Matt

>  
> 
> Class MyPojo {
> 
>  
> 
>             private Set mySet;
> 
>  
> 
> }
> 
>  
> 
> Using JXPath, I am trying to add a new object to my
> Set object called
> mySet by using an expression as follows:
> 
>  
> 
> context.setValue("mySet/", "New object on set");
> 
>  
> 
> However, this does not work when attempting to add
> elements to a
> collection (as it's trying to replace the Set object
> with my new
> String).  I'm not sure how one would do this with
> the setValue method,
> but any help would be appreciated.
> 
>  
> 
> Regards,
> 
>  
> 
> Jeff
> 
> 
> This email (and any attachments) is intended only
> for the use of the individual or entity named above
> and may contain information that is privileged and
> confidential. If you are not the intended recipient,
> or have unauthorized access, you are hereby notified
> that copying, disseminating, distributing or taking
> any action in reliance on this email is strictly
> prohibited<br />
> 
> Opinions, conclusions and other information in this
> message that do not relate to the official business
> of our firm shall be understood as neither given nor
> endorsed by it.
> 



 
________________________________________________________________________
____________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


This email (and any attachments) is intended only for the use of the individual or entity
named above and may contain information that is privileged and confidential. If you are not
the intended recipient, or have unauthorized access, you are hereby notified that copying,
disseminating, distributing or taking any action in reliance on this email is strictly prohibited<br
/>

Opinions, conclusions and other information in this message that do not relate to the official
business of our firm shall be understood as neither given nor endorsed by it.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message