public Resource createObjectFromString(String resourceName) throws InstantiationException, IllegalAccessException, NotExtendingResourceException {
  Class objectClass=registeredClasses.get(resourceName);
  try {
    return (Resource)objectClass.newInstance();
  }
 catch (  InstantiationException e) {
    throw e;
  }
catch (  IllegalAccessException e) {
    throw e;
  }
catch (  ClassCastException e) {
    throw new NotExtendingResourceException(objectClass + " is not inheriting Resource");
  }
}

public Resource createObjectFromString ( String resourceName ) throws InstantiationException , IllegalAccessException , NotExtendingResourceException { Class objectClass = registeredClasses . get ( resourceName ) ; try { return ( Resource ) objectClass . newInstance ( ) ; } catch ( InstantiationException e ) { throw e ; } catch ( IllegalAccessException e ) { throw e ; } catch ( ClassCastException e ) { throw new NotExtendingResourceException ( objectClass + " is not inheriting Resource" ) ; } }
creates an instance of an object via its name .
