[microservices] IDEA-353802 Added documentation

GitOrigin-RevId: 2562ba8b8d80860dc0718edff65f20e9766b1ae7
This commit is contained in:
Marat Dinmukhametov
2024-06-17 14:52:38 +03:00
committed by intellij-monorepo-bot
parent fe51586332
commit 24900db474

View File

@@ -50,11 +50,19 @@ public interface JavaMainMethodProvider extends PossiblyDumbAware {
@Contract(pure = true)
@Nullable PsiMethod findMainInClass(@NotNull PsiClass clazz);
/**
* @param clazz class to check
* @return a pretty class name. e.x. for Kotlin it allows to return `MyClass` instead of `MyClass.Companion`
*/
@Contract(pure = true)
default @Nullable String getMainClassName(@NotNull PsiClass clazz) {
return ClassUtil.getJVMClassName(clazz);
}
/**
* @param psiElement element to check
* @return true if the given element or its parent is the main method, false otherwise
*/
@Contract(pure = true)
default boolean isMain(@NotNull PsiElement psiElement) {
PsiMethod psiMethod = PsiTreeUtil.getParentOfType(psiElement, PsiMethod.class);