use of org.motechproject.tasks.annotations.TaskActionParam in project motech by motech.
the class TaskAnnotationBeanPostProcessor method getActionParams.
private SortedSet<ActionParameter> getActionParams(Method method) {
SortedSet<ActionParameter> parameters = new TreeSet<>();
int order = 0;
for (Annotation[] annotations : method.getParameterAnnotations()) {
for (Annotation annotation : annotations) {
if (annotation instanceof TaskActionParam) {
LOGGER.debug("The @TaskActionParam annotation was found in parameters from method: {}", method.getName());
TaskActionParam param = (TaskActionParam) annotation;
LOGGER.debug("Task action parameter: {} added", param.displayName());
parameters.add(new ActionParameterBuilder().setDisplayName(param.displayName()).setKey(param.key()).setType(param.type()).setOrder(order).setRequired(param.required()).build());
++order;
}
}
}
return parameters.isEmpty() ? null : parameters;
}
Aggregations