Package com.atlassian.crowd.util
Interface InstanceFactory
- All Known Implementing Classes:
SpringContextInstanceFactory
public interface InstanceFactory
An interface to easily instantiate objects from classes.
-
Method Summary
Modifier and TypeMethodDescription<T> TgetInstance(Class<T> clazz) Gets an instance of a class.getInstance(String className) Get an instance of a class.getInstance(String className, ClassLoader classLoader) Get an instance of a class from a specific classloader.
-
Method Details
-
getInstance
Get an instance of a class.- Parameters:
className- name of class.- Returns:
- instance of class.
- Throws:
ClassNotFoundException- if the class does not exist.
-
getInstance
Get an instance of a class from a specific classloader.- Parameters:
className- name of class.classLoader- class loader.- Returns:
- instance of class.
- Throws:
ClassNotFoundException- if the class does not exist.
-
getInstance
Gets an instance of a class.- Type Parameters:
T- type of class.- Parameters:
clazz- class.- Returns:
- instance of class.
-