Hi Ed... Don't forget that EL has String-based "type coercion" and then there's the basic PropertyEditor stuff from java.beans. Beans binding (JSR 295) was expected to have some notion of conversion IIRC, and that's only the JCP stuff. Spring and others have done conversion frameworks as well, with what are arguably varying degrees of success. I think it's possible to do good, fully-featured Java object conversion, but that (a) it's bigger than can comfortably fit in Bean Validation and (b) it's a shame to limit the feature to conversion when the more generic term "transformation" can encompass the closely-related concept of object *copying*.
Shameless self-promotion: see the Therian library [1]. Docs are more or less nonexistent as of now, but Therian provides transformation plumbing so that you can say, e.g.:
public Bar convertToBar(@NotNull Foo foo) {
final Bar result = therianContext.eval(Convert.to(Bar.class, Positions.readOnly(foo));
return result;
}
I conceived Therian when I was working with JSF so TherianContext extends ELContext. My goal was that it should be easy to plug Therian into JSF for conversions. I haven't actually gotten around to trying this yet, but Therian was based on my experience as a user and developer of the older Morph transformation (etc.) library, and having found it quite easy to plug my Morph transformations into JSF, I don't anticipate any difficulty.
Personally, I like Therian's design, but I am also aware that some will find it a bit unwieldy (in the unlikely event that anyone ever even learns of its existence ;P ). I would hope that any broader JSR would be interface-based so as not to preclude the like of Therian being plugged in as a potential implementation, but I can tell you I am exhausted just imagining a specification negotiation in the object transformation space.
br,
Matt