}
private List<Injectable> getInjectables(AbstractResourceMethod method) {
List<Injectable> list = new ArrayList<Injectable>(method.getParameters().size());
for (int i = 0; i < method.getParameters().size(); i++) {
Parameter p = method.getParameters().get(i);
if (Parameter.Source.ENTITY == p.getSource()) {
if (FormDataMultiPart.class.isAssignableFrom(p.getParameterClass())) {
list.add(new FormDataMultiPartInjectable());
} else {
list.add(null);
}
} else if (p.getAnnotation().annotationType() == FormDataParam.class) {
if (Collection.class == p.getParameterClass() || List.class == p.getParameterClass()) {
Class c = ReflectionHelper.getGenericClass(p.getParameterType());
if (FormDataBodyPart.class == c) {
list.add(new ListFormDataBodyPartMultiPartInjectable(p.getSourceName()));
} else if (FormDataContentDisposition.class == c) {
list.add(new ListFormDataContentDispositionMultiPartInjectable(p.getSourceName()));
}
} else if (FormDataBodyPart.class == p.getParameterClass()) {
list.add(new FormDataBodyPartMultiPartInjectable(p.getSourceName()));
} else if (FormDataContentDisposition.class == p.getParameterClass()) {
list.add(new FormDataContentDispositionMultiPartInjectable(p.getSourceName()));
} else {
list.add(new FormDataMultiPartParamInjectable(p));
}
} else {
Injectable injectable = getInjectableProviderContext().getInjectable(p, ComponentScope.PerRequest);