Here you can find the source of lookupProviderByName( final ServiceRegistry registry, final String providerClassName)
Parameter | Description |
---|---|
registry | the registry to lookup from. |
providerClassName | name of the provider class. |
public static <T> T lookupProviderByName( final ServiceRegistry registry, final String providerClassName)
//package com.java2s; import javax.imageio.spi.ServiceRegistry; public class Main { /**/*from w ww. j av a 2 s .c o m*/ * THIS METHOD WILL ME MOVED/RENAMED, DO NOT USE. * * @param registry the registry to lookup from. * @param providerClassName name of the provider class. * * @return the provider instance, or {@code null}. */ public static <T> T lookupProviderByName( final ServiceRegistry registry, final String providerClassName) { try { return (T) registry.getServiceProviderByClass(Class .forName(providerClassName)); } catch (ClassNotFoundException ignore) { return null; } } }