1
1
/*
2
- * Copyright 2002-2013 the original author or authors.
2
+ * Copyright 2002-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
36
36
*/
37
37
public class CollectingReaderEventListener implements ReaderEventListener {
38
38
39
- private final List defaults = new LinkedList ();
39
+ private final List < DefaultsDefinition > defaults = new LinkedList <> ();
40
40
41
- private final Map componentDefinitions = new LinkedHashMap <>(8 );
41
+ private final Map < String , ComponentDefinition > componentDefinitions = new LinkedHashMap <>(8 );
42
42
43
- private final Map aliasMap = new LinkedHashMap <>(8 );
43
+ private final Map <String , List <AliasDefinition >> aliasMap = new LinkedHashMap <>(8 );
44
+
45
+ private final List <ImportDefinition > imports = new LinkedList <>();
44
46
45
- private final List imports = new LinkedList ();
46
47
47
48
@ Override
48
49
public void defaultsRegistered (DefaultsDefinition defaultsDefinition ) {
49
50
this .defaults .add (defaultsDefinition );
50
51
}
51
52
52
- public List getDefaults () {
53
+ public List < DefaultsDefinition > getDefaults () {
53
54
return Collections .unmodifiableList (this .defaults );
54
55
}
55
56
@@ -59,35 +60,35 @@ public void componentRegistered(ComponentDefinition componentDefinition) {
59
60
}
60
61
61
62
public ComponentDefinition getComponentDefinition (String name ) {
62
- return ( ComponentDefinition ) this .componentDefinitions .get (name );
63
+ return this .componentDefinitions .get (name );
63
64
}
64
65
65
66
public ComponentDefinition [] getComponentDefinitions () {
66
- Collection collection = this .componentDefinitions .values ();
67
- return ( ComponentDefinition []) collection .toArray (new ComponentDefinition [collection .size ()]);
67
+ Collection < ComponentDefinition > collection = this .componentDefinitions .values ();
68
+ return collection .toArray (new ComponentDefinition [collection .size ()]);
68
69
}
69
70
70
71
@ Override
71
72
public void aliasRegistered (AliasDefinition aliasDefinition ) {
72
- List aliases = ( List ) this .aliasMap .get (aliasDefinition .getBeanName ());
73
+ List < AliasDefinition > aliases = this .aliasMap .get (aliasDefinition .getBeanName ());
73
74
if (aliases == null ) {
74
- aliases = new ArrayList ();
75
+ aliases = new ArrayList <> ();
75
76
this .aliasMap .put (aliasDefinition .getBeanName (), aliases );
76
77
}
77
78
aliases .add (aliasDefinition );
78
79
}
79
80
80
- public List getAliases (String beanName ) {
81
- List aliases = ( List ) this .aliasMap .get (beanName );
82
- return aliases == null ? null : Collections .unmodifiableList (aliases );
81
+ public List < AliasDefinition > getAliases (String beanName ) {
82
+ List < AliasDefinition > aliases = this .aliasMap .get (beanName );
83
+ return ( aliases != null ? Collections .unmodifiableList (aliases ) : null );
83
84
}
84
85
85
86
@ Override
86
87
public void importProcessed (ImportDefinition importDefinition ) {
87
88
this .imports .add (importDefinition );
88
89
}
89
90
90
- public List getImports () {
91
+ public List < ImportDefinition > getImports () {
91
92
return Collections .unmodifiableList (this .imports );
92
93
}
93
94
0 commit comments