Generic type question

View: New views
2 Messages — Rating Filter:   Alert me  

Generic type question

by Pedro H. O. dos Santos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, I'm trying to visit parents components with an special interface like:

   component.visitParents(IFeedback.class, new IVisitor<Component>)

and the methods signature is blocking me:
Component class code:

    public final <C extends Component> Object visitParents(final Class<C> c,
final IVisitor<Component> visitor)

any special reason for this generic type for class parameter need to extend
Component?
In the MarkupContainer wicket has an similar method than do not:

    public final <S extends Component> Object visitChildren(final Class<?>
clazz, final IVisitor<S> visitor)

--
Pedro Henrique Oliveira dos Santos

Re: Generic type question

by Juergen Donnerstag :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Fixed.

On Fri, Oct 23, 2009 at 9:33 PM, Pedro Santos <pedrosans@...> wrote:

> Hi, I'm trying to visit parents components with an special interface like:
>
>   component.visitParents(IFeedback.class, new IVisitor<Component>)
>
> and the methods signature is blocking me:
> Component class code:
>
>    public final <C extends Component> Object visitParents(final Class<C> c,
> final IVisitor<Component> visitor)
>
> any special reason for this generic type for class parameter need to extend
> Component?
> In the MarkupContainer wicket has an similar method than do not:
>
>    public final <S extends Component> Object visitChildren(final Class<?>
> clazz, final IVisitor<S> visitor)
>
> --
> Pedro Henrique Oliveira dos Santos
>