Class BeanFactoryObjectFactory
java.lang.Object
com.github.robtimus.obfuscation.spring.BeanFactoryObjectFactory
- All Implemented Interfaces:
ObjectFactory
An
ObjectFactory
that is backed by an AutowireCapableBeanFactory
.
It will try to lookup a bean of the given type first. If none is available, a new instance is created using the backing bean factory.
This allows created instances to have autowired fields of their own.- Author:
- Rob Spoor
-
Constructor Summary
ConstructorDescriptionBeanFactoryObjectFactory
(AutowireCapableBeanFactory beanFactory) Creates a new object factory. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.github.robtimus.obfuscation.annotation.ObjectFactory
characterRepresentationProvider, characterRepresentationProvider, characterRepresentationProvider, characterRepresentationProvider, characterRepresentationProvider, characterRepresentationProvider, obfuscator, obfuscator, obfuscator, obfuscator, obfuscator, obfuscator, obfuscator, obfuscator, obfuscator, obfuscator, obfuscatorProvider, obfuscatorProvider
-
Constructor Details
-
BeanFactoryObjectFactory
Creates a new object factory.- Parameters:
beanFactory
- The backing bean factory.- Throws:
NullPointerException
- If the given bean factory isnull
.
-
-
Method Details
-
instance
- Specified by:
instance
in interfaceObjectFactory
-