immutable constructor example

42 views
Skip to first unread message

paul b

unread,
Aug 11, 2011, 5:16:02 AM8/11/11
to PODAM
Hi,
In the examples provided there is usage of podam with immutable
constructors. For a muttable class you would use something like:

PodamFactory factory = new PodamFactoryImpl();
Pojo myPojo = factory.manufacturePojo(Pojo.class);

But how is this possible with immutable constructors. Please excuse
me if this seems like a noobie question. Can you please provide an
example of how to implement this?

Thanks

Marco Tedone

unread,
Aug 11, 2011, 3:36:56 PM8/11/11
to po...@googlegroups.com
Dear Paul,

The best example is to read the source code, available at GitHub.

To make a long story short, if PODAM does not find a public, no arg
constructor, it will use introspection to find all constructors, and it will
use the first for which it can create a value for all of its arguments.

HTH,

Marco

Reply all
Reply to author
Forward
0 new messages