commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank W. Zammetti" <fzli...@omnytex.com>
Subject Re: [Beanutils] Determine type of bean field
Date Thu, 01 Jun 2006 20:49:53 GMT
On Thu, June 1, 2006 4:43 pm, Craig McClanahan wrote:
>> Have you tried:
>>
>> ((List)fieldValues).toArray(new String[0])
>>
>> which offers control over the runtime type of the returned array, here
>> an array of Strings?
>
>
> That's part of the equation, but you also have to cast the overall result:
>
> (String[]) ((List)fieldValues).toArray(new String[0])
>
> -Rahul

Ok, I'm with you so far... but what if you don't know the type of the
target array until runtime?  I need to dynamically determine the element
type of the target array, then construct a new array instance to pass to
toArray() here.  I'm messing around right now, but haven't stumbled on the
right answer yet...

>
> Craig

Frank


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


Mime
View raw message