I think the correct signature (if Java would have permitted it) should be:
public final <R,C extends Component & T, T> R visitParents(final Class<T> c, final IVisitor<? super C, R> visitor)
The problem is that java does not allow intersection types with type parameters. So we have to choose between 'C extends T' or 'C extends Component'. I think C extends T is the best option, but this makes it impossible to use a visitor on Component if T is an interface:
public final <R, T> R visitParents(final Class<T> c, final IVisitor<? super T, R> visitor)
Another option is 2 methods, one for interfaces and one for components, so add this one:
public final <R, T> R visitParentContainers(final Class<?> c, final IVisitor<? super MarkupContainer, R> visitor)
In either case, it is important to use '? super X', because it allows you to reuse visitors for which C is bound to a superclass (just as with Comparator).