@Override @SuppressWarnings("rawtypes") public Binding set(@Nonnull Class<? extends Annotation> param) { Preconditions.checkNotNull(param); // Parameter annotation appears on the alias target Class<? extends Annotation> real = Qualifiers.resolveAliases(param); final Parameter annot = real.getAnnotation(Parameter.class); if (annot == null) { throw new IllegalArgumentException(param.toString() + "has no Parameter annotation"); } Class<?> type = annot.value(); Binding<?> binding; if (type.equals(File.class)) { binding = LenskitBindingImpl.wrap(bind(File.class), new StringToFileConversion()); } else { binding = bind(annot.value()); } return binding.withQualifier(param); }
@Override @SuppressWarnings("rawtypes") public Binding set(@Nonnull Class<? extends Annotation> param) { Preconditions.checkNotNull(param); // Parameter annotation appears on the alias target Class<? extends Annotation> real = Qualifiers.resolveAliases(param); final Parameter annot = real.getAnnotation(Parameter.class); if (annot == null) { throw new IllegalArgumentException(param.toString() + "has no Parameter annotation"); } Class<?> type = annot.value(); Binding<?> binding; if (type.equals(File.class)) { binding = LenskitBindingImpl.wrap(bind(File.class), new StringToFileConversion()); } else { binding = bind(annot.value()); } return binding.withQualifier(param); }