TypeConversionDescriptor (PsiElement context) { if (context instanceof PsiReferenceExpression) { if (context.getParent() instanceof PsiMethodCallExpression) { return findReverseConversionForMethodCall(context); } } else if (context instanceof PsiNewExpression) { return new TypeConversionDescriptor("new $type$($qualifier$)", "$qualifier$"); } else if (context instanceof PsiMethodCallExpression) { return findReverseConversionForMethodCall(((PsiMethodCallExpression)context).getMethodExpression()); } return null; }