35
35
36
36
import org .w3c .dom .Element ;
37
37
import org .w3c .dom .Node ;
38
+ import org .w3c .dom .NodeList ;
38
39
39
40
/**
40
41
* Parser to populate the given {@link ClassPathScanningCandidateComponentProvider} with {@link TypeFilter}s parsed from
@@ -85,13 +86,13 @@ public TypeFilterParser(XmlReaderContext readerContext) {
85
86
*/
86
87
public Collection <TypeFilter > parseTypeFilters (Element element , Type type ) {
87
88
88
- var nodeList = element .getChildNodes ();
89
+ NodeList nodeList = element .getChildNodes ();
89
90
Collection <TypeFilter > filters = new HashSet <>();
90
91
91
- for (var i = 0 ; i < nodeList .getLength (); i ++) {
92
+ for (int i = 0 ; i < nodeList .getLength (); i ++) {
92
93
93
- var node = nodeList .item (i );
94
- var childElement = type .getElement (node );
94
+ Node node = nodeList .item (i );
95
+ Element childElement = type .getElement (node );
95
96
96
97
if (childElement == null ) {
97
98
continue ;
@@ -116,12 +117,12 @@ public Collection<TypeFilter> parseTypeFilters(Element element, Type type) {
116
117
*/
117
118
protected TypeFilter createTypeFilter (Element element , ClassLoader classLoader ) {
118
119
119
- var filterType = element .getAttribute (FILTER_TYPE_ATTRIBUTE );
120
- var expression = element .getAttribute (FILTER_EXPRESSION_ATTRIBUTE );
120
+ String filterType = element .getAttribute (FILTER_TYPE_ATTRIBUTE );
121
+ String expression = element .getAttribute (FILTER_EXPRESSION_ATTRIBUTE );
121
122
122
123
try {
123
124
124
- var filter = FilterType .fromString (filterType );
125
+ FilterType filter = FilterType .fromString (filterType );
125
126
return filter .getFilter (expression , classLoader );
126
127
127
128
} catch (ClassNotFoundException ex ) {
@@ -171,7 +172,7 @@ public TypeFilter getFilter(String expression, ClassLoader classLoader) {
171
172
@ Override
172
173
public TypeFilter getFilter (String expression , ClassLoader classLoader ) throws ClassNotFoundException {
173
174
174
- var filterClass = classLoader .loadClass (expression );
175
+ Class <?> filterClass = classLoader .loadClass (expression );
175
176
if (!TypeFilter .class .isAssignableFrom (filterClass )) {
176
177
throw new IllegalArgumentException (
177
178
"Class is not assignable to [" + TypeFilter .class .getName () + "]: " + expression );
@@ -199,7 +200,7 @@ public TypeFilter getFilter(String expression, ClassLoader classLoader) throws C
199
200
*/
200
201
static FilterType fromString (String typeString ) {
201
202
202
- for (var filter : FilterType .values ()) {
203
+ for (FilterType filter : FilterType .values ()) {
203
204
if (filter .name ().equalsIgnoreCase (typeString )) {
204
205
return filter ;
205
206
}
@@ -230,7 +231,7 @@ public enum Type {
230
231
Element getElement (Node node ) {
231
232
232
233
if (node .getNodeType () == Node .ELEMENT_NODE ) {
233
- var localName = node .getLocalName ();
234
+ String localName = node .getLocalName ();
234
235
if (elementName .equals (localName )) {
235
236
return (Element ) node ;
236
237
}
0 commit comments