use of org.osgl.inject.BeanSpec in project actframework by actframework.
the class CliContextParamLoader method findFieldOptionLoaders.
private void findFieldOptionLoaders(Class c, List<OptionLoader> optionLoaders) {
if (injector.isProvided(c)) {
// No field injection for a provided host
return;
}
for (Field field : $.fieldsOf(c, true)) {
Type type = field.getGenericType();
Annotation[] annotations = field.getAnnotations();
String bindName = bindName(annotations, field.getName());
BeanSpec spec = BeanSpec.of(type, annotations, bindName, injector);
boolean provided = injector.isProvided(spec);
ParamValueLoader loader = provided ? ProvidedValueLoader.get(spec, injector) : findContextSpecificLoader(bindName, spec);
if (loader instanceof OptionLoader) {
optionLoaders.add((OptionLoader) loader);
}
}
}
Aggregations