This code handles the case where the class is not public or the constructor is not public.
| Modifier and Type | Field and Description |
|---|---|
| private static final ClassValue | DECLARED_CTORS
Cache from a class to its default constructor. |
| private static final Class | |
| private static final Object[] | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | cleanCache()
Deprecated
for removal. this method is empty by now and will be removed in next major version
|
| public static <T> T | |
| public static Object | |
| public static <T> T | |
| public static <T> Class | Returns: null if inference fails.Infers the instantiable implementation class that can be assigned to the given field type. |
| private static <T> Constructor |
| DECLARED_CTORS | back to summary |
|---|---|
| private static final ClassValue<Constructor<T>> DECLARED_CTORS Cache from a class to its default constructor. | |
| emptyClass | back to summary |
|---|---|
| private static final Class<T>[] emptyClass | |
| emptyObject | back to summary |
|---|---|
| private static final Object[] emptyObject | |
| logger | back to summary |
|---|---|
| private static final Logger logger | |
| ClassFactory | back to summary |
|---|---|
| private ClassFactory() | |
| cleanCache | back to summary |
|---|---|
| public static void cleanCache()
Deprecated for removal. this method is empty by now and will be removed in next major version
| |
| create | back to summary |
|---|---|
| public static <T> T create(Class<T> clazz) The same as | |
| create | back to summary |
|---|---|
| public static Object create(Method method) Call a method in the factory class to get the object. | |
| create0 | back to summary |
|---|---|
| public static <T> T create0(final Class<T> clazz) throws IllegalAccessException, InvocationTargetException, InstantiationException Creates a new instance of the class but throw exceptions without catching it. | |
| inferImplClass | back to summary |
|---|---|
| public static <T> Class Infers the instantiable implementation class that can be assigned to the given field type.
| |
| tryGetDeclaredConstructor | back to summary |
|---|---|
| private static <T> Constructor | |