Package org.hibernate.models.spi
Interface ClassLoading
- All Known Implementing Classes:
SimpleClassLoading
Access to load resources from a ClassLoader
-
Method Summary
Modifier and TypeMethodDescription<T> Class<T> classForName(String name) Obtain aClassreference by name<T> Class<T> findClassForName(String name) Like classForName(String), except here we simply returnnullif there is not a matching class.<S> Collection<S> loadJavaServices(Class<S> serviceType) Discovers and instantiates implementations of the givenJava servicecontract.locateResource(String resourceName) Locate a resource by name
-
Method Details
-
classForName
Obtain aClassreference by name- Parameters:
name- The name of the class- Returns:
- The
Classobject with the given name - Throws:
UnknownClassException- If no registration is found with the givenname
-
findClassForName
Like classForName(String), except here we simply returnnullif there is not a matching class. This is often useful, e.g., when looking for a package-info. -
locateResource
Locate a resource by name- Parameters:
resourceName- The name of the resource to resolve- Returns:
- The located resource;
may return
nullto indicate the resource was not found
-
loadJavaServices
Discovers and instantiates implementations of the givenJava servicecontract.- Type Parameters:
S- The type of the service contract- Parameters:
serviceType- The java type defining the service contract- Returns:
- The ordered set of discovered services.
-