public class SquirrelProvider extends Object implements SquirrelSingleton
| Constructor and Description |
|---|
SquirrelProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearRegistry() |
<T> Class<T> |
getImplementation(Class<T> clz)
Return the current registered implementation.
|
static SquirrelProvider |
getInstance() |
<T> T |
newInstance(Class<T> clz)
Create a new instance of the requested class using the internal registry.
|
<T> T |
newInstance(Class<T> clz,
Class<?>[] argTypes,
Object[] args)
Create a new instance of the requested class using the internal registry.
|
<T> T |
newInstance(TypeReference<T> typeRef) |
<T> T |
newInstance(TypeReference<T> typeRef,
Class<?>[] argTypes,
Object[] args) |
void |
register(Class<?> clazz,
Class<?> implementationClass)
Register the implementation class for a certain class.
|
static void |
setInstance(SquirrelProvider instance) |
void |
unregister(Class<?> clazz) |
public static SquirrelProvider getInstance()
public static void setInstance(SquirrelProvider instance)
public <T> T newInstance(TypeReference<T> typeRef)
public <T> T newInstance(TypeReference<T> typeRef, Class<?>[] argTypes, Object[] args)
public <T> T newInstance(Class<T> clz)
T - type of new instanceclz - class of new instancepublic <T> T newInstance(Class<T> clz, Class<?>[] argTypes, Object[] args)
T - type of new instanceclz - class of new instanceargTypes - arguments type of new instance constructorargs - arguments of new instance constructorpublic void register(Class<?> clazz, Class<?> implementationClass)
clazz - register classimplementationClass - implementation class of register classpublic void unregister(Class<?> clazz)
public void clearRegistry()
public <T> Class<T> getImplementation(Class<T> clz)
clz - registered classCopyright © 2013–2016. All rights reserved.