PsiTypeVisitor<String> () { return new PsiTypeVisitor<String>() { @Override public String visitPrimitiveType(@NotNull PsiPrimitiveType primitiveType) { return primitiveType.getCanonicalText(); } @Override public String visitClassType(@NotNull PsiClassType classType) { PsiClass aClass = classType.resolve(); if (aClass == null) { return ""; } return getJVMClassName(aClass); } @Override public String visitArrayType(@NotNull PsiArrayType arrayType) { PsiType componentType = arrayType.getComponentType(); String typePresentation = componentType.accept(this); if (arrayType.getDeepComponentType() instanceof PsiPrimitiveType) { return typePresentation + "[]"; } if (componentType instanceof PsiClassType) { typePresentation = "L" + typePresentation + ";"; } return "[" + typePresentation; } }; }