in src/main/java/org/apache/sling/scripting/sightly/render/ObjectModel.java [492:510]
public static Method findBeanMethod(Class<?> cls, String baseName) {
if (cls == null || StringUtils.isEmpty(baseName)) {
return null;
}
Method[] publicMethods = cls.getMethods();
String capitalized = StringUtils.capitalize(baseName);
for (Method method : publicMethods) {
if (method.getParameterTypes().length == 0) {
String methodName = method.getName();
if (baseName.equals(methodName) || ("get" + capitalized).equals(methodName) || ("is" + capitalized).equals(methodName)) {
if (isMethodAllowed(method)) {
return method;
}
break;
}
}
}
return null;
}