Automatic type conversion for named parameters (from String)

View: New views
2 Messages — Rating Filter:   Alert me  

Automatic type conversion for named parameters (from String)

by joe panico-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I noticed a feature in the release notes:

New (since 2.7):
Automatic type conversion for named parameters (from String)

How do I use that feature?

thanks,

Joe

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Automatic type conversion for named parameters (from String)

by Paul Hammant-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Joe,

This should do it :-

   public class ComponentThatNeedsAnInt {
       public ComponentThatNeedsAnInt(int someParam) {
       }
   }

   pico.addComponent("someParam", "1234");
   
pico
.as
(Characteristics.USE_NAMES).addComponent(ComponentThatNeedsAnInt.class);

Regards,

- Paul

On Jul 3, 2009, at 6:37 PM, joe panico wrote:

> Hello,
>
> I noticed a feature in the release notes:
>
> New (since 2.7):
> Automatic type conversion for named parameters (from String)
>
> How do I use that feature?
>
> thanks,
>
> Joe
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email