[
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
{code}
ReceiverA { DataSource<String> dataSource; }
ReceiverB { DataSource<Integer> dataSource; }
{code}
The following code is typically some kind of library code, e.g. some kind of
factory that creates an object.
{code}
Object receiver = receiverClass.newInstance();
dataSourceField.set(receiver, coercer.coerce(myInputValue,
dataSourceField.getGenericType()));
{code}
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: 5.1.0.5
> 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