You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Mark Clarke <Ma...@ClarkeConsulting.co.za> on 2003/05/04 19:06:31 UTC

[beanutils] primitive return types for getProperty

Hi all,
According to the documentation getProperty returns an object and does
not do conversion. I have step through the code for a property that
returns a byte and getProperty returns a Byte object. The code however
fails later I think because some part of the code is expecting a byte
and get an object or because some part expects a object and gets a
primitive type. What does the getProperty method return for primitive
type and  conversely what happens with the setProperty method and
primitive types.

TIA,.

Mark



Re: [beanutils] primitive return types for getProperty

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
hi mark

(you didn't specify the class but i'm going to assume that you meant 
PropertyUtils.)

there's conversions and conversions :)

the beanutils methods take objects and so all primitives will be converted 
to and from the standard wrapper objects (eg. Integer for int). the other 
kind of conversion is the custom conversion using converters registered 
with ConvertUtils. when the method talks about no conversions, it means no 
custom conversions. (the documentation is a little misleading and so 
probably needs altering to make this more clear.)

- robert

On Sunday, May 4, 2003, at 06:06 PM, Mark Clarke wrote:

> Hi all,
> According to the documentation getProperty returns an object and does
> not do conversion. I have step through the code for a property that
> returns a byte and getProperty returns a Byte object. The code however
> fails later I think because some part of the code is expecting a byte
> and get an object or because some part expects a object and gets a
> primitive type. What does the getProperty method return for primitive
> type and  conversely what happens with the setProperty method and
> primitive types.
>
> TIA,.
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>