Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate to Value Type #91

Open
geoffreywiseman opened this issue Jun 7, 2013 · 5 comments
Open

Translate to Value Type #91

geoffreywiseman opened this issue Jun 7, 2013 · 5 comments

Comments

@geoffreywiseman
Copy link
Owner

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)

@oliverzy
Copy link

oliverzy commented Oct 8, 2013

What about a generic type converter which can take a source type and target type?
Currently the ValueTypeTranslator can only take a target type

@geoffreywiseman
Copy link
Owner Author

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.

@geoffreywiseman
Copy link
Owner Author

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?

@oliverzy
Copy link

oliverzy commented Oct 8, 2013

Yes, you are right, Geoffrey. That's what I am expecting.

@geoffreywiseman
Copy link
Owner Author

The basics of this are in place now with ValueTypeTranslator in v2.0; shouldn't be too hard to extend this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants