Spring: PropertyPlaceHolderConfigurer to set values for non-string/integer properties

Posted by babyangel86 on Stack Overflow See other posts from Stack Overflow or by babyangel86
Published on 2010-03-01T16:54:44Z Indexed on 2010/03/14 11:35 UTC
Read the original article Hit count: 455

Filed under:
|
|

Hi,

All the examples I have seen where the PropertyPlaceHolderConfigurer is used seem to be setting simple values like Strings and ints.

How do you use the PPC to set the values of classes.

E.g. If i had a class signature Source(String name, DistributionSample batch, DistributionSample delay)

How would I go about setting the batch and delay properties.

There is also a small catch. DistributionSample is an abstract class. On the bright side, The class that is using the propertyPlaceHolder knows the beanName of the "Solid" class that needs to be instantiated.

Any help would be much appreciated.

© Stack Overflow or respective owner

Related posts about spring

Related posts about java