You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by kyle m <ky...@hotmail.com> on 2009/02/03 18:38:36 UTC

[betwixt] Parsing an array from a string

Class:
class Thing extends BaseClass
{
private String[] slots;
...
}

XML:
<Thing
        ...
        slots="lights_front_left,lights_front_right"
/>

I'd like Betwixt to read in the slots value and let me parse the string. I've tried ObjectStringConverters, which seems to overlook the slots value all together, Rules, although I'm not sure if I was using them right, and a handful of other solutions I cobbled together. Unfortunately nothing panned out.

Does anybody have any suggestions?

Thanks!

_________________________________________________________________
Windows Live™ Hotmail®…more than just e-mail. 
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_howitworks_012009

Re: [betwixt] Parsing an array from a string

Posted by James Carman <ja...@carmanconsulting.com>.
You could use a pseudo property called slotsString.  Inside the
setter, you parse it (using String.split() I would think).

On Tue, Feb 3, 2009 at 12:38 PM, kyle m <ky...@hotmail.com> wrote:
>
> Class:
> class Thing extends BaseClass
> {
> private String[] slots;
> ...
> }
>
> XML:
> <Thing
>        ...
>        slots="lights_front_left,lights_front_right"
> />
>
> I'd like Betwixt to read in the slots value and let me parse the string. I've tried ObjectStringConverters, which seems to overlook the slots value all together, Rules, although I'm not sure if I was using them right, and a handful of other solutions I cobbled together. Unfortunately nothing panned out.
>
> Does anybody have any suggestions?
>
> Thanks!
>
> _________________________________________________________________
> Windows Live™ Hotmail(R)…more than just e-mail.
> http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_howitworks_012009

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