use of com.iggroup.oss.restdoclet.doclet.type.FieldParameter in project RESTdoclet by IG-Group.
the class DocletUtils method getPublicFields.
/**
* Return a list of all fields that have a public getter
*
* @param classDoc class documentation
* @return list of all fields that have a public getter
*/
public static Collection<FieldParameter> getPublicFields(final ClassDoc classDoc) {
ArrayList<FieldParameter> fields = new ArrayList<FieldParameter>();
MethodDoc[] methods = classDoc.methods();
for (FieldDoc fieldDoc : classDoc.fields(false)) {
boolean found = false;
for (MethodDoc md : methods) {
if (md.name().equalsIgnoreCase(GETTER_PREFIX + fieldDoc.name())) {
found = true;
}
}
if (found) {
fields.add(new FieldParameterBuilder().build(new FieldParameter(), fieldDoc));
}
}
return fields;
}
Aggregations