Package com.intellij.psi

Examples of com.intellij.psi.PsiAnnotationParameterList


  public static String getAccessVisibity(@NotNull PsiAnnotation psiAnnotation) {
    return convertAcessLevelToJavaString(findAnnotationPropertyValue(psiAnnotation, "access", false));
  }

  public static String findAnnotationPropertyValue(@NotNull PsiAnnotation psiAnnotation, String propertyName, boolean isDefaultProperty) {
    PsiAnnotationParameterList annotationParameterList = psiAnnotation.getParameterList();
    String value = "";
    for (PsiNameValuePair pair : annotationParameterList.getAttributes()) {
      if (propertyName.equals(pair.getName()) || (isDefaultProperty && null == pair.getName())) {
        value = pair.getText();
        break;
      }
    }
View Full Code Here


  protected void removeDefaultAnnotation(@NotNull PsiModifierListOwner targetElement, @NotNull Class<? extends Annotation> annotationClass) {
    final PsiAnnotation psiAnnotation = PsiAnnotationUtil.findAnnotation(targetElement, annotationClass);
    if (null != psiAnnotation) {
      boolean hasOnlyDefaultValues = true;

      final PsiAnnotationParameterList psiAnnotationParameterList = psiAnnotation.getParameterList();
      for (PsiNameValuePair nameValuePair : psiAnnotationParameterList.getAttributes()) {
        if (null != psiAnnotation.findDeclaredAttributeValue(nameValuePair.getName())) {
          hasOnlyDefaultValues = false;
          break;
        }
      }
View Full Code Here

TOP

Related Classes of com.intellij.psi.PsiAnnotationParameterList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.