Java 类com.intellij.psi.impl.PsiVariableEx 实例源码

项目:intellij-ce-playground    文件:JavaSuppressionUtil.java   
@Nullable
public static String getInspectionIdSuppressedInAnnotationAttribute(PsiElement element) {
  if (element instanceof PsiLiteralExpression) {
    final Object value = ((PsiLiteralExpression)element).getValue();
    if (value instanceof String) {
      return (String)value;
    }
  }
  else if (element instanceof PsiReferenceExpression) {
    final PsiElement psiElement = ((PsiReferenceExpression)element).resolve();
    if (psiElement instanceof PsiVariableEx) {
      final Object val = ((PsiVariableEx)psiElement).computeConstantValue(new THashSet<PsiVariable>());
      if (val instanceof String) {
        return (String)val;
      }
    }
  }
  return null;
}
项目:tools-idea    文件:JavaSuppressionUtil.java   
@Nullable
public static String getInspectionIdSuppressedInAnnotationAttribute(PsiElement element) {
  if (element instanceof PsiLiteralExpression) {
    final Object value = ((PsiLiteralExpression)element).getValue();
    if (value instanceof String) {
      return (String)value;
    }
  }
  else if (element instanceof PsiReferenceExpression) {
    final PsiElement psiElement = ((PsiReferenceExpression)element).resolve();
    if (psiElement instanceof PsiVariableEx) {
      final Object val = ((PsiVariableEx)psiElement).computeConstantValue(new HashSet<PsiVariable>());
      if (val instanceof String) {
        return (String)val;
      }
    }
  }
  return null;
}
项目:consulo-java    文件:JavaSuppressionUtil.java   
@Nullable
public static String getInspectionIdSuppressedInAnnotationAttribute(PsiElement element) {
  if (element instanceof PsiLiteralExpression) {
    final Object value = ((PsiLiteralExpression)element).getValue();
    if (value instanceof String) {
      return (String)value;
    }
  }
  else if (element instanceof PsiReferenceExpression) {
    final PsiElement psiElement = ((PsiReferenceExpression)element).resolve();
    if (psiElement instanceof PsiVariableEx) {
      final Object val = ((PsiVariableEx)psiElement).computeConstantValue(new HashSet<PsiVariable>());
      if (val instanceof String) {
        return (String)val;
      }
    }
  }
  return null;
}