private PropertyAccessorElement internalLookUpGetter(String getterName, LibraryElement library,
boolean includeThisClass) {
HashSet<ClassElement> visitedClasses = new HashSet<ClassElement>();
ClassElement currentElement = this;
if (includeThisClass) {
PropertyAccessorElement element = currentElement.getGetter(getterName);
if (element != null && element.isAccessibleIn(library)) {
return element;
}
}
while (currentElement != null && visitedClasses.add(currentElement)) {
for (InterfaceType mixin : currentElement.getMixins()) {
ClassElement mixinElement = mixin.getElement();
if (mixinElement != null) {
PropertyAccessorElement element = mixinElement.getGetter(getterName);
if (element != null && element.isAccessibleIn(library)) {
return element;
}
}
}
InterfaceType supertype = currentElement.getSupertype();
if (supertype == null) {
return null;
}
currentElement = supertype.getElement();
PropertyAccessorElement element = currentElement.getGetter(getterName);
if (element != null && element.isAccessibleIn(library)) {
return element;
}
}
return null;
}