@SuppressWarnings({ "unchecked", "rawtypes" })
public static ExternalResourceDependency createExternalResourceDependency(Field field) {
ExternalResource era = ReflectionUtil.getAnnotation(field, ExternalResource.class);
// Get the binding key for the specified field. If no key is set, use the field name as key.
String key = era.key();
if (key.length() == 0) {
key = field.getName();
}
// Get the type of class/interface a resource has to implement to bind to the annotated field.