Package org.apache.cayenne.di.spi
Class DefaultAdhocObjectFactory
java.lang.Object
org.apache.cayenne.di.spi.DefaultAdhocObjectFactory
- All Implemented Interfaces:
AdhocObjectFactory
A default implementation of
AdhocObjectFactory
that creates objects
using default no-arg constructor and injects dependencies into annotated
fields. Note that constructor injection is not supported by this factory.- Since:
- 3.1
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultAdhocObjectFactory
(Injector injector, ClassLoaderManager classLoaderManager) -
Method Summary
Modifier and TypeMethodDescriptionClass
<?> getJavaClass
(String className) Returns a Java class loaded using ClassLoader returned fromClassLoaderManager.getClassLoader(String)
for a given class name.<T> T
newInstance
(Class<? super T> superType, String className) Returns an instance of "className" that implements "superType", injecting dependencies from the registry into it.
-
Field Details
-
injector
-
classLoaderManager
-
-
Constructor Details
-
DefaultAdhocObjectFactory
- Since:
- 4.0
-
-
Method Details
-
newInstance
Description copied from interface:AdhocObjectFactory
Returns an instance of "className" that implements "superType", injecting dependencies from the registry into it.- Specified by:
newInstance
in interfaceAdhocObjectFactory
-
getJavaClass
Description copied from interface:AdhocObjectFactory
Returns a Java class loaded using ClassLoader returned fromClassLoaderManager.getClassLoader(String)
for a given class name.- Specified by:
getJavaClass
in interfaceAdhocObjectFactory
-