Add nullability annotations and javadoc for new methods in CodeStyleFacade

GitOrigin-RevId: 5a7281ff7d2e5834b57596b51ea8bcbcef4c5b94
This commit is contained in:
Stanislav Utikeev
2019-12-03 15:11:09 +00:00
committed by intellij-monorepo-bot
parent 280f04c4a9
commit eda2380286
2 changed files with 27 additions and 6 deletions
@@ -102,9 +102,30 @@ public abstract class CodeStyleFacade {
@Deprecated
public abstract String getLineSeparator();
public abstract boolean useSpaceBeforeComma(PsiFile psiFile, Language language);
/**
* Determines whether a comma before space is needed for given {@code PsiFile} in given {@code Language} context.
*
* @param psiFile File to determine settings
* @param language Context language
* @return whether the space before comma is needed
*/
public abstract boolean useSpaceBeforeComma(@NotNull PsiFile psiFile, @NotNull Language language);
public abstract boolean useSpaceAfterComma(PsiFile psiFile, Language language);
/**
* Determines whether a comma after space is needed for given {@code PsiFile} in given {@code Language} context.
*
* @param psiFile File to determine settings
* @param language Context language
* @return whether the space after comma is needed
*/
public abstract boolean useSpaceAfterComma(@NotNull PsiFile psiFile, @NotNull Language language);
public abstract boolean useSpaceAroundAssignmentOperators(PsiFile psiFile, Language language);
/**
* Determines whether assignment operator should be surrounded with spaces for given {@code PsiFile} in given {@code Language} context.
*
* @param psiFile File to determine settings
* @param language Context language
* @return whether to surround assignment operator with spaces
*/
public abstract boolean useSpaceAroundAssignmentOperators(@NotNull PsiFile psiFile, @NotNull Language language);
}
@@ -107,17 +107,17 @@ public class CodeStyleFacadeImpl extends CodeStyleFacade {
}
@Override
public boolean useSpaceBeforeComma(PsiFile psiFile, Language language) {
public boolean useSpaceBeforeComma(@NotNull PsiFile psiFile, @NotNull Language language) {
return CodeStyle.getLanguageSettings(psiFile, language).SPACE_BEFORE_COMMA;
}
@Override
public boolean useSpaceAfterComma(PsiFile psiFile, Language language) {
public boolean useSpaceAfterComma(@NotNull PsiFile psiFile, @NotNull Language language) {
return CodeStyle.getLanguageSettings(psiFile, language).SPACE_AFTER_COMMA;
}
@Override
public boolean useSpaceAroundAssignmentOperators(PsiFile psiFile, Language language) {
public boolean useSpaceAroundAssignmentOperators(@NotNull PsiFile psiFile, @NotNull Language language) {
return CodeStyle.getLanguageSettings(psiFile, language).SPACE_AROUND_ASSIGNMENT_OPERATORS;
}
}