net.sf.eos.util
Class SupplierFactory<T>

java.lang.Object
  extended by net.sf.eos.util.SupplierFactory<T>

public final class SupplierFactory<T>
extends Object


Constructor Summary
SupplierFactory()
           
 
Method Summary
static
<T> ConfigurableSupplier<T>
newSupplier(Class<? extends ConfigurableSupplier<T>> clazz, Configuration config)
          Creates a new instance of the ConfigurableSupplier class.
static
<T> Supplier<T>
newSupplier(Class<? extends Supplier<T>> clazz)
          Creates a new instance of the Supplier class.
static
<T> Supplier<T>
newSupplier(String configName, Configuration config)
          Creates a new instance of the Supplier class.
static
<T> Supplier<T>
newSupplier(String configName, Configuration config, String defaultClazzName)
          Creates a new instance of the Supplier class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SupplierFactory

public SupplierFactory()
Method Detail

newSupplier

public static final <T> Supplier<T> newSupplier(Class<? extends Supplier<T>> clazz)
Creates a new instance of the Supplier class. The supplier must support a default Constructor.

Type Parameters:
T - the type of the supplier
Parameters:
clazz - the class instance of the supplier
Returns:
the supplier

newSupplier

public static final <T> ConfigurableSupplier<T> newSupplier(Class<? extends ConfigurableSupplier<T>> clazz,
                                                            Configuration config)
Creates a new instance of the ConfigurableSupplier class. The supplier must support a default Constructor.

Type Parameters:
T - the type of the supplier
Parameters:
clazz - the class instance of the supplier
Returns:
the supplier

newSupplier

public static final <T> Supplier<T> newSupplier(String configName,
                                                Configuration config)
Creates a new instance of the Supplier class. The supplier must support a default Constructor.

Type Parameters:
T - the type of the supplier
Parameters:
configName - the name of the key that value in config is the name of a supplier class
config - the configuration containing the class name
Returns:
the supplier

newSupplier

public static final <T> Supplier<T> newSupplier(String configName,
                                                Configuration config,
                                                String defaultClazzName)
Creates a new instance of the Supplier class. The supplier must support a default Constructor.

Type Parameters:
T - the type of the supplier
Parameters:
configName - the name of the key that value in config is the name of a supplier class
config - the configuration containing the class name
defaultClazzName - the default supplier class name
Returns:
the supplier


Copyright © 2008. All Rights Reserved.