@Override
public LinkedHashMap<String,AnnotatedMethod> findGetters(VisibilityChecker<?> visibilityChecker,
Collection<String> ignoredProperties)
{
LinkedHashMap<String,AnnotatedMethod> results = new LinkedHashMap<String,AnnotatedMethod>();
final PropertyNamingStrategy naming = _config.getPropertyNamingStrategy();
for (AnnotatedMethod am : _classInfo.memberMethods()) {
/* note: signature has already been checked to some degree
* via filters; however, no checks were done for arg count
*/
// 16-May-2009, tatu: JsonIgnore processed earlier already
if (am.getParameterCount() != 0) {
continue;
}
/* So far so good: final check, then; has to either
* (a) be marked with JsonProperty (/JsonGetter/JsonSerialize) OR
* (b) be public AND have suitable name (getXxx or isXxx)
*/
String propName = _annotationIntrospector.findGettablePropertyName(am);
if (propName != null) {
/* As per [JACKSON-64], let's still use mangled name if possible;
* and only if not use unmodified method name
*/
if (propName.length() == 0) {
propName = okNameForAnyGetter(am, am.getName());
if (propName == null) {
propName = am.getName();
}
// [JACKSON-178] Also, allow renaming via strategy
if (naming != null) {
propName = naming.nameForGetterMethod(_config, am, propName);
}
}
} else {
propName = am.getName();
// [JACKSON-166], need to separate getXxx/isXxx methods
if (propName.startsWith("get")) { // nope, but is public bean-getter name?
if (!visibilityChecker.isGetterVisible(am)) {
continue;
}
propName = okNameForGetter(am, propName);
} else {
if (!visibilityChecker.isIsGetterVisible(am)) {
continue;
}
propName = okNameForIsGetter(am, propName);
}
// null return value means 'not valid'
if (propName == null) continue;
// [JACKSON-384] Plus, should not include "AnyGetter" as regular getter..
if (_annotationIntrospector.hasAnyGetterAnnotation(am)) continue;
// [JACKSON-178] Also, allow renaming via strategy
if (naming != null) {
propName = naming.nameForGetterMethod(_config, am, propName);
}
}
if (ignoredProperties != null) {
if (ignoredProperties.contains(propName)) {