public Class<?> findImplementation(Class<?> interfase) throws IOException, ClassNotFoundException {
  String className=findString(interfase.getName());
  Class<?> impl=_classLoader.loadClass(className);
  if (!interfase.isAssignableFrom(impl)) {
    throw new ClassCastException("Class not of type: " + interfase.getName());
  }
  return impl;
}

public Class < ? > findImplementation ( Class < ? > interfase ) throws IOException , ClassNotFoundException { String className = findString ( interfase . getName ( ) ) ; Class < ? > impl = _classLoader . loadClass ( className ) ; if ( ! interfase . isAssignableFrom ( impl ) ) { throw new ClassCastException ( "Class not of type: " + interfase . getName ( ) ) ; } return impl ; }
assumes the class specified points to a file in the classpath that contains the name of a class that implements or is a subclass of the specfied class . < p / > any class that cannot be loaded will be cause an exception to be thrown . < p / > example classpath : < p / > meta - inf / java . io . inputstream # contains the classname org . acme . acmeinputstream meta - inf / java . io . outputstream < p / > resourcefinder finder = new resourcefinder ( " meta - inf / " ) ; class clazz = finder . findimplementation ( java . io . inputstream . class ) ; clazz . getname ( ) ; / / returns " org . acme . acmeinputstream "
