final InjectPlugin ipannotation = field.getAnnotation(InjectPlugin.class);
if (ipannotation == null) continue;
if (ipannotation.isOptional()) continue;
final Dependency d = new Dependency();
d.capabilites = ipannotation.requiredCapabilities();
d.pluginClass = (Class<? extends Plugin>) getTrueDependencyInterfaceType(field.getType());
d.isOptional = ipannotation.isOptional();
rval.add(d);
}
// And setter methods as well (aka Scala hack)
for (Method method : methods) {
method.setAccessible(true);
final InjectPlugin ipannotation = method.getAnnotation(InjectPlugin.class);
if (ipannotation == null) continue;
if (ipannotation.isOptional()) continue;
final Dependency d = new Dependency();
d.capabilites = ipannotation.requiredCapabilities();
d.pluginClass = (Class<? extends Plugin>) getTrueDependencyInterfaceType(method.getParameterTypes()[0]);
d.isOptional = ipannotation.isOptional();
rval.add(d);