Package org.apache.wicket.spring
Class FieldBeansCollector
- java.lang.Object
-
- org.apache.wicket.spring.FieldBeansCollector
-
public class FieldBeansCollector extends Object
Convenience class to extract information about the type and generics of a field to inject. The field is a List, a Map or a Set and the generic type of its elements is extracted as well- Author:
- Tobias Soloschenko, Andrea Del Bene
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FieldBeansCollector.FieldType
-
Constructor Summary
Constructors Constructor Description FieldBeansCollector(org.springframework.core.ResolvableType fieldResolvableType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBean(String beanName, Object bean)
Adds compatible bean to the field.Object
getBeansToInject()
Returns an instance containing all the beans collected for the field and compatible with the type of the field.FieldBeansCollector.FieldType
getFieldType()
-
-
-
Constructor Detail
-
FieldBeansCollector
public FieldBeansCollector(org.springframework.core.ResolvableType fieldResolvableType)
-
-
Method Detail
-
getBeansToInject
public Object getBeansToInject()
Returns an instance containing all the beans collected for the field and compatible with the type of the field.- Returns:
- the instance to inject into the field.
-
addBean
public void addBean(String beanName, Object bean)
Adds compatible bean to the field. This means that the field type is Map, a List or a Set and that the given bean is compatible with its elements type.- Parameters:
beanName
- the name of the bean to injectbean
- the bean to inject
-
getFieldType
public FieldBeansCollector.FieldType getFieldType()
-
-