com.atlassian.crowd.util
Interface InstanceFactory

All Known Implementing Classes:
SpringContextInstanceFactory

public interface InstanceFactory

An interface to easily instantiate objects from classes.


Method Summary
<T> T
getInstance(Class<T> clazz)
          Gets an instance of a class.
 Object getInstance(String className)
          Get an instance of a class.
 Object getInstance(String className, ClassLoader classLoader)
          Get an instance of a class from a specific classloader.
 

Method Detail

getInstance

Object getInstance(String className)
                   throws ClassNotFoundException
Get an instance of a class.

Parameters:
className - name of class.
Returns:
instance of class.
Throws:
ClassNotFoundException - if the class does not exist.

getInstance

Object getInstance(String className,
                   ClassLoader classLoader)
                   throws ClassNotFoundException
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

<T> T getInstance(Class<T> clazz)
Gets an instance of a class.

Type Parameters:
T - type of class.
Parameters:
clazz - class.
Returns:
instance of class.


Copyright © 2012 Atlassian. All Rights Reserved.