Project

General

Profile

« Previous | Next » 

Revision 46958

using type parameters for FactoryBean

View differences:

HCMSubscriptionListFactory.java
2 2

  
3 3
import java.util.List;
4 4

  
5
import com.google.common.collect.Lists;
6
import eu.dnetlib.enabling.actions.SubscriptionAction;
5 7
import org.springframework.beans.factory.FactoryBean;
6 8
import org.springframework.beans.factory.annotation.Autowired;
7 9

  
8
import eu.dnetlib.enabling.actions.SubscriptionAction;
9

  
10 10
/**
11 11
 * This class acts as a simple registry of msro subscription actions.
12 12
 * 
......
19 19
 * 
20 20
 */
21 21
@SuppressWarnings("rawtypes")
22
public class HCMSubscriptionListFactory implements FactoryBean {
22
public class HCMSubscriptionListFactory implements FactoryBean<List<SubscriptionAction>> {
23 23

  
24 24
	/**
25 25
	 * actions. Spring injects all the declared SubscriptionActions here.
26 26
	 */
27 27
	@Autowired(required = false)
28
	private List<SubscriptionAction> actions;
28
	private List<SubscriptionAction> actions = Lists.newArrayList();
29 29

  
30 30
	public List<SubscriptionAction> getActions() {
31 31
		return actions;
......
41 41
	 * @see org.springframework.beans.factory.FactoryBean#getObject()
42 42
	 */
43 43
	@Override
44
	public Object getObject() {
44
	public List<SubscriptionAction> getObject() {
45 45
		return getActions();
46 46
	}
47 47

  
48 48
	@Override
49
	public Class<?> getObjectType() {
50
		return null;
49
	public Class<List> getObjectType() {
50
		return List.class;
51 51
	}
52 52

  
53 53
	@Override

Also available in: Unified diff