[
https://issues.apache.org/jira/browse/TAP5-1213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13996309#comment-13996309
]
Lance edited comment on TAP5-1213 at 5/13/14 12:09 PM:
-------------------------------------------------------
>From what I can see, this can be resolved by adding the following to the
>public API:
{code}
java.lang.reflect.Type PropertyConduit.getPropertyGenericType()
java.lang.reflect.Type Binding.getBindingGenericType()
java.lang.reflect.Type ComponentResources.getBoundGenericType(String
parameterName)
{code}
I'm guessing that only PropBinding would return a type from
getBindingGenericType(). All other bindings would return null.
I'm guessing that PropertyConduitSource will need to call
Field.getGenericType() or Method.getGenericReturnType()
-
http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Field.html#getGenericType()
-
http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Method.html#getGenericReturnType()
was (Author: uklance):
>From what I can see, this can be resolved by adding the following to the
>public API:
{code}
java.lang.reflect.Type PropertyConduit.getPropertyGenericType()
java.lang.reflect.Type Binding.getBindingGenericType()
java.lang.reflect.Type ComponentResources.getBoundGenericType(String
parameterName)
{code}
I'm guessing that only PropBinding would return a type from
getBindingGenericType(). All other bindings would return null.
> ComponentResources should give access to generic parameters of bound types
> --------------------------------------------------------------------------
>
> Key: TAP5-1213
> URL: https://issues.apache.org/jira/browse/TAP5-1213
> Project: Tapestry 5
> Issue Type: Improvement
> Components: tapestry-core
> Affects Versions: 5.1.0.7
> Reporter: Michael Wyraz
> Labels: bulk-close-candidate
>
> ComponentResources can tell which type is bound to a given parameter via
> getBoundType(ParameterName). This is a great feature but only works for
> non-generic types. If a generic type is bound, it's impossible to access the
> generic parameters.
> Example:
> A component can bind to a Set of something. getBoundType returns
> "java.util.Set" for this parameter. So it' not possible to coerce the entries
> of this set to the target type.
--
This message was sent by Atlassian JIRA
(v6.2#6252)