fieldName = name;
}
// First look for fields annotated by @Parameter specifying the name
for (Field field : type.getDeclaredFields()) {
if (field.isAnnotationPresent(Parameter.class)) {
Parameter parameter = field.getAnnotation(Parameter.class);
if (fieldName.equals(parameter.name())) {
return field;
}
}
}
// Default to field matching given name