MemberModel () { PsiElement startElement = nextChild(); PsiElement element = parseModifiers(startElement); if (element == null) return null; PsiJavaToken token = tryCast(parseModifiers(parseTypeParams(element)), PsiJavaToken.class); if (token == null) { MemberType memberType = parseMemberType(element); return memberType == null ? null : new MemberModel(textRange(startElement, element), memberType); } boolean hasTypeParams = token != element; token = parseType(token); if (token == null) return null; token = parseIdentifier(token); if (token == null) return null; token = tryCast(nextChild(), PsiJavaToken.class); if (token == null) return null; if (!hasTypeParams) { PsiJavaToken endElement = parseField(token); if (endElement != null) { return new MemberModel(textRange(startElement, endElement), MemberType.FIELD); } } PsiJavaToken endElement = parseMethod(token); if (endElement != null) { return new MemberModel(textRange(startElement, endElement), MemberType.METHOD); } return null; }