String (PsiResourceListElement resource) { if (resource instanceof PsiResourceVariable) { return ((PsiResourceVariable)resource).getName(); } else if (resource instanceof PsiResourceExpression) { return ((PsiResourceExpression)resource).getExpression().getText(); } LOG.error("Unknown PsiResourceListElement type: " + resource.getClass()); return null; }