public class InjectionMetadata extends Object
Used by AutowiredAnnotationBeanPostProcessor
,
CommonAnnotationBeanPostProcessor
and
PersistenceAnnotationBeanPostProcessor
.
Modifier and Type | Class and Description |
---|---|
static class |
InjectionMetadata.InjectedElement
A single injected element.
|
Modifier and Type | Field and Description |
---|---|
static InjectionMetadata |
EMPTY
An empty
InjectionMetadata instance with no-op callbacks. |
Constructor and Description |
---|
InjectionMetadata(Class<?> targetClass,
Collection<InjectionMetadata.InjectedElement> elements)
Create a new
InjectionMetadata instance . |
Modifier and Type | Method and Description |
---|---|
void |
checkConfigMembers(RootBeanDefinition beanDefinition) |
void |
clear(PropertyValues pvs)
Clear property skipping for the contained elements.
|
static InjectionMetadata |
forElements(Collection<InjectionMetadata.InjectedElement> elements,
Class<?> clazz)
Return an
InjectionMetadata instance, possibly for empty elements. |
void |
inject(Object target,
String beanName,
PropertyValues pvs) |
static boolean |
needsRefresh(InjectionMetadata metadata,
Class<?> clazz)
Check whether the given injection metadata needs to be refreshed.
|
public static final InjectionMetadata EMPTY
InjectionMetadata
instance with no-op callbacks.public InjectionMetadata(Class<?> targetClass, Collection<InjectionMetadata.InjectedElement> elements)
InjectionMetadata instance
.
Preferably use forElements(java.util.Collection<org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement>, java.lang.Class<?>)
for reusing the EMPTY
instance in case of no elements.
targetClass
- the target classelements
- the associated elements to injectforElements(java.util.Collection<org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement>, java.lang.Class<?>)
public void checkConfigMembers(RootBeanDefinition beanDefinition)
public void inject(Object target, @Nullable String beanName, @Nullable PropertyValues pvs) throws Throwable
Throwable
public void clear(@Nullable PropertyValues pvs)
public static InjectionMetadata forElements(Collection<InjectionMetadata.InjectedElement> elements, Class<?> clazz)
InjectionMetadata
instance, possibly for empty elements.elements
- the elements to inject (possibly empty)clazz
- the target classInjectionMetadata
instance,
or EMPTY
in case of no elementspublic static boolean needsRefresh(@Nullable InjectionMetadata metadata, Class<?> clazz)
metadata
- the existing metadata instanceclazz
- the current target classtrue
indicating a refresh, false
otherwise