tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Rietzler (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAP5-996) TypeCoercer should take a Type instead of a Class
Date Mon, 04 Apr 2011 06:56:05 GMT

    [ https://issues.apache.org/jira/browse/TAP5-996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13015292#comment-13015292

Peter Rietzler commented on TAP5-996:

Here is a simple example that should clarify this

ReceiverA { DataSource<String> dataSource; }
ReceiverB { DataSource<Integer> dataSource; }

The following code is typically some kind of library code, e.g. some kind of factory that
creates an object.

Object receiver = receiverClass.newInstance();
dataSourceField.set(receiver, coercer.coerce(myInputValue, dataSourceField.getGenericType()));

Now the coercer can check which data source to create depending on the actual parameterization
of the field.

> TypeCoercer should take a Type instead of a Class
> -------------------------------------------------
>                 Key: TAP5-996
>                 URL: https://issues.apache.org/jira/browse/TAP5-996
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>    Affects Versions:
>            Reporter: Peter Rietzler
> Contribution type could still be Class, but the coercer would have the chance to use
generic type information at runtime what would be very useful in some of our use cases! 

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message