Java Code Examples for com.intellij.psi.PsiMember#getContainingClass()

The following examples show how to use com.intellij.psi.PsiMember#getContainingClass() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ElementUtils.java    From aircon with MIT License 5 votes vote down vote up
static String getInnerClassName(PsiMember field) {
	final StringBuilder builder = new StringBuilder();
	PsiMember currElement = field;
	while ((currElement = currElement.getContainingClass()) != null) {
		builder.insert(0, currElement.getName() + ".");
	}
	final String res = builder.toString();
	return res.substring(0, res.length() - 1);
}
 
Example 2
Source File: LombokProcessorProvider.java    From lombok-intellij-plugin with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@NotNull
Collection<LombokProcessorData> getApplicableProcessors(@NotNull PsiMember psiMember) {
  Collection<LombokProcessorData> result = Collections.emptyList();
  if (verifyLombokAnnotationPresent(psiMember)) {
    result = new ArrayList<>();

    addApplicableProcessors(psiMember, result);
    final PsiClass psiClass = psiMember.getContainingClass();
    if (null != psiClass) {
      addApplicableProcessors(psiClass, result);
    }
  }
  return result;
}
 
Example 3
Source File: LombokProcessorProvider.java    From lombok-intellij-plugin with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private boolean verifyLombokAnnotationPresent(@NotNull PsiMember psiMember) {
  if (PsiAnnotationSearchUtil.checkAnnotationsSimpleNameExistsIn(psiMember, registeredAnnotationNames)) {
    return true;
  }

  final PsiClass psiClass = psiMember.getContainingClass();
  return null != psiClass && verifyLombokAnnotationPresent(psiClass);
}
 
Example 4
Source File: PsiCustomUtil.java    From intellij-spring-assistant with MIT License 4 votes vote down vote up
@Nullable
private static PsiType eraseFreeTypeParameters(@Nullable PsiType psiType,
    @NotNull PsiMember member) {
  final PsiClass containingClass = member.getContainingClass();
  return eraseFreeTypeParameters(psiType, containingClass);
}