Support immutable datamodels

Description

At the moment Stripes does not support creation of immutable datamodels.
So if you have an actionbean such as:

1 2 3 4 5 6 7 8 9 10 11 12 13 public class TestAction implements ActionBean { private TestUser testUser; /// -- snipped public TestUser getTestUser() { return testUser; } public void setTestUser(TestUser testUser) { this.testUser = testUser; } }

Where TestUser is an immutable class, the current DefaultActionBeanPropertyBinder will not support creation of TestUser.
While in this example it is easy to implement an ActionBeanPropertyBinder that could potentially do this for you, it is becomes less trivial when you have List<TestUser> as your property.

Indexed Property handling is done in DefaultActionBeanPropertyBinder but it is hard to intercept in order to implement this type of functionality.
This is not an easy problem to solve though as knowing constructor parameter order is much harder than just finding the right setter.

Other frameworks have different ways of solving this (Jackson uses Constructor annotations, MyBatis uses mappings).
While this is one possible solution, another slightly easier solution may be to allow intermediate builders to be used.
Defining a Builder interface (or annotation) with just a single build method would suffice.

That builder could have the setters required and handle the building automatically.

Environment

None

Status

Assignee

Unassigned

Reporter

Tim Chen

Labels

None

Tester

None

Affects versions

Release 1.5.6

Priority

Major
Configure