Examples of PsiModifierListOwner


Examples of com.intellij.psi.PsiModifierListOwner

    return findAnnotation(element, annotationName) != null;
  }

  static PsiAnnotation findAnnotation(PsiElement element, String annotationName) {
    if (element instanceof PsiModifierListOwner) {
      PsiModifierListOwner listOwner = (PsiModifierListOwner) element;
      PsiModifierList modifierList = listOwner.getModifierList();

      if (modifierList != null) {
        for (PsiAnnotation psiAnnotation : modifierList.getAnnotations()) {
          if (annotationName.equals(psiAnnotation.getQualifiedName())) {
            return psiAnnotation;
View Full Code Here

Examples of com.intellij.psi.PsiModifierListOwner

  public static Set<String> getQualifierAnnotations(PsiElement element) {
    Set<String> qualifiedClasses = new HashSet<String>();

    if (element instanceof PsiModifierListOwner) {
      PsiModifierListOwner listOwner = (PsiModifierListOwner) element;
      PsiModifierList modifierList = listOwner.getModifierList();

      if (modifierList != null) {
        for (PsiAnnotation psiAnnotation : modifierList.getAnnotations()) {
          if (psiAnnotation != null && psiAnnotation.getQualifiedName() != null) {
            JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(element.getProject());
View Full Code Here

Examples of com.intellij.psi.PsiModifierListOwner

  }


  @Nullable
  protected static PsiModifierListOwner getContainer(final PsiElement element) {
    PsiModifierListOwner listOwner = PsiTreeUtil.getParentOfType(element, PsiParameter.class, false);
    if (listOwner == null) {
      final PsiIdentifier psiIdentifier = PsiTreeUtil.getParentOfType(element, PsiIdentifier.class, false);
      if (psiIdentifier != null && psiIdentifier.getParent() instanceof PsiModifierListOwner) {
        listOwner = (PsiModifierListOwner) psiIdentifier.getParent();
      }
View Full Code Here

Examples of com.intellij.psi.PsiModifierListOwner

  }

  protected void filterToleratedElements(@NotNull Collection<? extends PsiModifierListOwner> definedConstructors) {
    final Iterator<? extends PsiModifierListOwner> methodIterator = definedConstructors.iterator();
    while (methodIterator.hasNext()) {
      PsiModifierListOwner definedConstructor = methodIterator.next();
      if(PsiAnnotationUtil.isAnnotatedWith(definedConstructor, Tolerate.class)) {
        methodIterator.remove();
      }
    }
  }
View Full Code Here

Examples of com.intellij.psi.PsiModifierListOwner

  }

  public static PsiMatcherExpression hasModifier(final String modifier, final boolean shouldHave) {
    return new PsiMatcherExpression() {
      public Boolean match(PsiElement element) {
        PsiModifierListOwner owner = element instanceof PsiModifierListOwner ? (PsiModifierListOwner) element : null;

        if (owner != null && owner.hasModifierProperty(modifier) == shouldHave) return Boolean.TRUE;
        return Boolean.FALSE;
      }
    };
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.