You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by Mridul Muralidharan <Mr...@Sun.COM> on 2004/11/25 12:56:10 UTC

Control extension and generics.

Hi all,

  Is there any way of picking up the parameter section in a 
parameterized type of the return type for a ControlExtension from the 
impl's invoke() method ?

What I mean is , for an example like this :

"
@ControlExtension
public interface CustomControl extends BaseControl{
    @SomeAnnotation (name="value")
    public Iterator<SomeClass> getValues() throws SomeException;
}
"
Can I get to both "Iterator" and "SomeClass" as the defined return type 
for this method "getValues" ?
Also , is there any way of identifying this for the method parameters also ?

Thanks in advance
Regards
Mridul

-- 
The death rate on Earth is: .... (computing) .... One per person.



Re: Control extension and generics.

Posted by Kyle Marvin <ky...@gmail.com>.
Hi Mridul,

Generic type information for return value and parameters are available
using Reflection on the java.lang.reflect.Method instance (the called
extension method) passed to Extensible.invoke().

See the getGenericReturnType() and getGenericParameterTypes() APIs on
java.lang.reflect.Method for details.

-- Kyle

On Thu, 25 Nov 2004 17:26:10 +0530, Mridul Muralidharan
<mr...@sun.com> wrote:
> Hi all,
> 
>   Is there any way of picking up the parameter section in a
> parameterized type of the return type for a ControlExtension from the
> impl's invoke() method ?
> 
> What I mean is , for an example like this :
> 
> "
> @ControlExtension
> public interface CustomControl extends BaseControl{
>     @SomeAnnotation (name="value")
>     public Iterator<SomeClass> getValues() throws SomeException;
> }
> "
> Can I get to both "Iterator" and "SomeClass" as the defined return type
> for this method "getValues" ?
> Also , is there any way of identifying this for the method parameters also ?
> 
> Thanks in advance
> Regards
> Mridul
> 
> --
> The death rate on Earth is: .... (computing) .... One per person.
> 
>