@ SuppressWarnings ( "unchecked" ) private static < T > T createCustomComponent ( Class < T > componentType , Class < ? > componentClass , Map < String , String > configProperties ) throws Exception { if ( componentClass == null ) { throw new IllegalArgumentException ( "Invalid component spec (class not found)." ) ; //$NON-NLS-1$ } try { Constructor < ? > constructor = componentClass . getConstructor ( Map . class ) ; return ( T ) constructor . newInstance ( configProperties ) ; } catch ( Exception e ) { } return ( T ) componentClass . getConstructor ( ) . newInstance ( ) ; }
Creates a custom component from a loaded class .