Package com.sun.xml.bind.v2
Class ClassFactory
java.lang.Object
com.sun.xml.bind.v2.ClassFactory
Creates new instances of classes.
This code handles the case where the class is not public or the constructor is not public.
- Since:
- 2.0
- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static <T> T
The same ascreate0(java.lang.Class<T>)
but with an error handling to make the instantiation error fatal.static Object
Call a method in the factory class to get the object.static <T> T
Creates a new instance of the class but throw exceptions without catching it.static <T> Class<? extends T>
inferImplClass
(Class<T> fieldType, Class[] knownImplClasses) Infers the instanciable implementation class that can be assigned to the given field type.
-
Constructor Details
-
ClassFactory
public ClassFactory()
-
-
Method Details
-
cleanCache
public static void cleanCache() -
create0
public static <T> T create0(Class<T> clazz) throws IllegalAccessException, InvocationTargetException, InstantiationException Creates a new instance of the class but throw exceptions without catching it. -
create
The same ascreate0(java.lang.Class<T>)
but with an error handling to make the instantiation error fatal. -
create
Call a method in the factory class to get the object. -
inferImplClass
Infers the instanciable implementation class that can be assigned to the given field type.- Returns:
- null if inference fails.
-