Java Code Examples for com.intellij.psi.PsiModifier#PRIVATE

The following examples show how to use com.intellij.psi.PsiModifier#PRIVATE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PsiModifierExtractor.java    From litho with Apache License 2.0 5 votes vote down vote up
private static Modifier psiModifierToModifier(PsiElement psiModifier) {
  switch (psiModifier.getText()) {
    case PsiModifier.ABSTRACT:
      return Modifier.ABSTRACT;
    case PsiModifier.FINAL:
      return Modifier.FINAL;
    case PsiModifier.NATIVE:
      return Modifier.NATIVE;
    case PsiModifier.PRIVATE:
      return Modifier.PRIVATE;
    case PsiModifier.PROTECTED:
      return Modifier.PROTECTED;
    case PsiModifier.PUBLIC:
      return Modifier.PUBLIC;
    case PsiModifier.STATIC:
      return Modifier.STATIC;
    case PsiModifier.STRICTFP:
      return Modifier.STRICTFP;
    case PsiModifier.SYNCHRONIZED:
      return Modifier.SYNCHRONIZED;
    case PsiModifier.TRANSIENT:
      return Modifier.TRANSIENT;
    case PsiModifier.VOLATILE:
      return Modifier.VOLATILE;
    default:
      // TODO better error message, ideally w/ line number
      throw new ComponentsProcessingException(
          "Unexpected Modifier, modifier is: " + psiModifier.getText());
  }
}
 
Example 2
Source File: LombokProcessorUtil.java    From lombok-intellij-plugin with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Nullable
@PsiModifier.ModifierConstant
private static String convertAccessLevelToJavaModifier(String value) {
  if (null == value || value.isEmpty()) {
    return PsiModifier.PUBLIC;
  }

  if ("PUBLIC".equals(value)) {
    return PsiModifier.PUBLIC;
  }
  if ("MODULE".equals(value)) {
    return PsiModifier.PACKAGE_LOCAL;
  }
  if ("PROTECTED".equals(value)) {
    return PsiModifier.PROTECTED;
  }
  if ("PACKAGE".equals(value)) {
    return PsiModifier.PACKAGE_LOCAL;
  }
  if ("PRIVATE".equals(value)) {
    return PsiModifier.PRIVATE;
  }
  if ("NONE".equals(value)) {
    return null;
  }
  return null;
}