517 |
* ClassClassException is thrown. |
* ClassClassException is thrown. |
518 |
* @since 1.3 |
* @since 1.3 |
519 |
*/ |
*/ |
520 |
public EventListener[] getListeners(Class listenerType) |
public <T extends EventListener> T[] getListeners(Class<T> listenerType) |
521 |
{ |
{ |
522 |
if (listenerType == ActionListener.class) |
if (listenerType == ActionListener.class) |
523 |
return getActionListeners(); |
return (T[]) getActionListeners(); |
524 |
return (EventListener[]) Array.newInstance(listenerType, 0); |
return (T[]) Array.newInstance(listenerType, 0); |
525 |
} |
} |
526 |
|
|
527 |
/*************************************************************************/ |
/*************************************************************************/ |