Created
December 16, 2016 00:30
-
-
Save ljnelson/338afd6428c622b8ea8a3819dbd8ca9d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private final void processInjectionPoint(@Observes final ProcessInjectionPoint<?, ?> event) { | |
if (event != null) { | |
final InjectionPoint ip = event.getInjectionPoint(); | |
assert ip != null; | |
final Set<Annotation> existingQualifiers = ip.getQualifiers(); | |
if (existingQualifiers != null && !existingQualifiers.isEmpty()) { | |
final Set<Annotation> newQualifiers = new HashSet<>(); | |
existingQualifiers.stream().forEach((qualifier) -> { | |
assert qualifier != null; | |
if (qualifier instanceof Key) { | |
newQualifiers.add(new PropertyLiteral(((Key)qualifier).value())); | |
} else { | |
newQualifiers.add(qualifier); | |
} | |
}); | |
event.configureInjectionPoint().qualifiers(newQualifiers); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment