|
11 | 11 | import javax.lang.model.element.ElementKind;
|
12 | 12 | import javax.lang.model.element.ExecutableElement;
|
13 | 13 | import javax.lang.model.element.TypeElement;
|
14 |
| -import javax.lang.model.type.TypeMirror; |
15 | 14 | import javax.lang.model.util.ElementFilter;
|
16 | 15 | import javax.lang.model.util.Elements;
|
17 | 16 | import javax.tools.StandardLocation;
|
@@ -338,24 +337,14 @@ private void readInjectModule(RoundEnvironment roundEnv) {
|
338 | 337 |
|
339 | 338 | private void registerSPI(Set<? extends Element> beans) {
|
340 | 339 | ElementFilter.typesIn(beans).stream()
|
341 |
| - .filter(InjectProcessor::isInjectExtension) |
| 340 | + .filter(this::isExtension) |
342 | 341 | .map(TypeElement::getQualifiedName)
|
343 | 342 | .map(Object::toString)
|
344 | 343 | .forEach(ProcessingContext::addInjectSPI);
|
345 | 344 | }
|
346 | 345 |
|
347 |
| - private static boolean isInjectExtension(TypeElement te) { |
348 |
| - return te.getInterfaces().stream() |
349 |
| - .map(TypeMirror::toString) |
350 |
| - .anyMatch(EXTENSION_TYPES::contains); |
| 346 | + private boolean isExtension(TypeElement te) { |
| 347 | + return APContext.isAssignable(te, "io.avaje.inject.spi.InjectExtension"); |
351 | 348 | }
|
352 | 349 |
|
353 |
| - private static final Set<String> EXTENSION_TYPES = Set.of( |
354 |
| - "io.avaje.inject.spi.ModuleOrdering", |
355 |
| - "io.avaje.inject.spi.AvajeModule", |
356 |
| - "io.avaje.inject.spi.InjectPlugin", |
357 |
| - "io.avaje.inject.spi.ConfigPropertyPlugin", |
358 |
| - "io.avaje.inject.spi.PropertyRequiresPlugin" |
359 |
| - ); |
360 |
| - |
361 | 350 | }
|
0 commit comments