Search in sources :

Example 11 with PsiTypeParameter

use of com.intellij.psi.PsiTypeParameter in project intellij-community by JetBrains.

the class AddMethodFix method generateTypeText.

static String generateTypeText(GrTypeDefinition aClass) {
    StringBuilder returnType = new StringBuilder(aClass.getName());
    final PsiTypeParameter[] typeParameters = aClass.getTypeParameters();
    if (typeParameters.length > 0) {
        returnType.append('<');
        for (PsiTypeParameter typeParameter : typeParameters) {
            returnType.append(typeParameter.getName()).append(", ");
        }
        returnType.replace(returnType.length() - 2, returnType.length(), ">");
    }
    return returnType.toString();
}
Also used : PsiTypeParameter(com.intellij.psi.PsiTypeParameter)

Aggregations

PsiTypeParameter (com.intellij.psi.PsiTypeParameter)11 PsiClass (com.intellij.psi.PsiClass)7 Nullable (org.jetbrains.annotations.Nullable)2 PsiElement (com.intellij.psi.PsiElement)1 PsiFile (com.intellij.psi.PsiFile)1 PsiTypeParameterListOwner (com.intellij.psi.PsiTypeParameterListOwner)1 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)1 SearchScope (com.intellij.psi.search.SearchScope)1 ArrayList (java.util.ArrayList)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 GroovyFile (org.jetbrains.plugins.groovy.lang.psi.GroovyFile)1 GrCodeReferenceElement (org.jetbrains.plugins.groovy.lang.psi.api.types.GrCodeReferenceElement)1 GrTypeArgumentList (org.jetbrains.plugins.groovy.lang.psi.api.types.GrTypeArgumentList)1