Results 1 to 2 of 2

Thread: setting bean properties at run time

  1. #1
    Join Date
    Apr 2007
    Posts
    1

    Default setting bean properties at run time

    I have some interface IMyInterface and a set of implementations of this interface. Every implementation has its own specific properties. At run time a user chooses the proper implementation and specifies property values for this implementation. So I need to get the right bean, set the property values and then I can use the bean via its interface.
    To get the proper implementation I use:
    Code:
    beanFactory.getBean(“implementation_key”);
    Problem is how to set (get) property values to the selected implementation bean (interface does not provide correspond getters and setters, because properties are specific for an implementation). Does Spring provide opportunity to set (get) the property values for my bean at run time?

    Pavel.

  2. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    BeanWrapperImpl might be the right tool. It depends on what form you have collected the property values. Or maybe you can use DataBinder?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •