Skip to content

Instantly share code, notes, and snippets.

@ljnelson
Last active February 11, 2017 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljnelson/f146c07f3fceac4231c4b0605516fb4a to your computer and use it in GitHub Desktop.
Save ljnelson/f146c07f3fceac4231c4b0605516fb4a to your computer and use it in GitHub Desktop.
// Note: no @Produces!
@ConfigurationValue
@Dependent
private static final Object produceConfigurationValue(final InjectionPoint injectionPoint, final Configurations configurations) {
Objects.requireNonNull(injectionPoint);
Objects.requireNonNull(configurations);
final String name = getConfigurationPropertyName(injectionPoint);
assert name != null;
return configurations.getValue(name, injectionPoint.getType()); // let's say this causes conversion
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment