PsiTypeVisitor<String> (boolean slashes) { return new PsiTypeVisitor<String>() { @Override public String visitPrimitiveType(@NotNull PsiPrimitiveType primitiveType) { return primitiveType.getKind().getBinaryName(); } @Override public String visitClassType(@NotNull PsiClassType classType) { PsiClass aClass = classType.resolve(); if (aClass == null) { return ""; } String jvmClassName = getJVMClassName(aClass); if (jvmClassName != null) { jvmClassName = "L" + (slashes ? jvmClassName.replace(".", "/") : jvmClassName) + ";"; } return jvmClassName; } @Override public String visitArrayType(@NotNull PsiArrayType arrayType) { return "[" + arrayType.getComponentType().accept(this); } }; }