Moo
Moo copied to clipboard
Translate to Value Type
Moo doesn't really understand how to translate to value types; good support for this could be as simple as supporting constructors, although Moo should also come with the ability to handle at least all the wrapper types and very common value types within the JDK (String, Integer, Number, Float, Double, etc)
What about a generic type converter which can take a source type and target type? Currently the ValueTypeTranslator can only take a target type
A sort of configurable type coercion mechanism?
To some degree you can already do that with the mvel support for invoking methods, but I culd imagine generalizing, sure.
oliverzy: Out of curiosity, why do you want the source type option? Are you expecting to have multiple source types that translate to the same destination type?
Yes, you are right, Geoffrey. That's what I am expecting.
The basics of this are in place now with ValueTypeTranslator
in v2.0; shouldn't be too hard to extend this further.