Checks if the given element has an annotation set.
@param clazz QDox class
@param annotationClazz Annotation class
@return true if annotation is present
17049
private boolean hasAnnotation(JavaAnnotatedElement clazz, Class<? extends Annotation> annotationClazz) {
    return clazz.getAnnotations().stream()
        .filter(item -> item.getType().isA(annotationClazz.getName()))
        .count() > 0;
  }
36632
private static List<Field> _getAnnotationColumns(Class<?> clazz, 
			Class<? extends Annotation> annoClazz) {
		if(clazz == null) {
			return new ArrayList<Field>();
		}
		
		List<Class<?>> classLink = new ArrayList<Class<?>>();
		Class<?> curClass = clazz;
		while (curClass != null) {
			classLink.add(curClass);
			curClass = curClass.getSuperclass();
		}
		
		return _getFields(classLink, annoClazz);
	}
164485
public function isClassAnnotatedWith($className, $annotationClassName)
    {
        if (!$this->initialized) {
            $this->initialize();
        }
        $className = $this->cleanClassName($className);

        $annotationClassName = $this->cleanClassName($annotationClassName);

        return (isset($this->annotatedClasses[$annotationClassName][$className]));
    }
1240684
@SuppressWarnings("static-method")
	protected boolean isOOActiveAnnotation(XAnnotation annotation) {
		final String name = annotation.getAnnotationType().getQualifiedName();
		return Strings.equal(Accessors.class.getName(), name)
				|| Strings.equal(Data.class.getName(), name)
				|| Strings.equal(Delegate.class.getName(), name)
				|| Strings.equal(ToString.class.getName(), name);
	}
1299112
public static boolean hasAnnotation(final List<AnnotationInstance> annotations, final String annotationClaszName) {
        final DotName annotationName = DotName.createSimple(annotationClaszName);
        for (final AnnotationInstance annotation : annotations) {
            if (annotation.name().equals(annotationName)) {
                return true;
            }
        }
        return false;
    }
1178602
public boolean isDocumentedAnnotation(TypeElement annotation) {
        for (AnnotationMirror anno : annotation.getAnnotationMirrors()) {
            if (getFullyQualifiedName(anno.getAnnotationType().asElement()).equals(
                    Documented.class.getName())) {
                return true;
            }
        }
        return false;
    }
1361057
public static boolean isInstantiable(Class<?> clazz)
  {
    if(clazz.isInterface()) {
      return false;
    }
    int m = clazz.getModifiers();
    if(Modifier.isAbstract(m)) {
      return false;
    }
    try {
      clazz.getDeclaredConstructor();
    }
    catch(NoSuchMethodException unused) {
      return false;
    }
    return true;
  }
587282
public static <T> boolean hasDeclaredGetterAndSetter(final Field field, Class<T> entityClazz) {
		boolean hasDeclaredAccessorsMutators = true;

		Method getter = retrieveGetterFrom(entityClazz, field.getName());
		Method setter = retrieveSetterFrom(entityClazz, field.getName());

		if(getter == null || setter == null) {
			hasDeclaredAccessorsMutators = false;
		}

		return hasDeclaredAccessorsMutators;
	}
1172111
private boolean hasAnnotation(Class c, Class targetClass, AnnotationRepository annotationRepository)
   {
      Collection<Annotation> values = annotationRepository.getAnnotation(targetClass);
      if (values == null)
         return false;
      for (Annotation annotation : values)
      {
         if (annotation.getClassName() != null && annotation.getClassName().equals(c.getName()))
            return true;
      }
      return false;

   }
317475
public static Field[] getAnnotationFields(Class<?> clazz, Class<? extends Annotation> annotationClass) {
        if (clazz == null || annotationClass == null) {
            return null;
        }

        List<Field> fields = getAllFieldsOfClass0(clazz);
        if (CollectionUtil.isEmpty(fields)) {
            return null;
        }

        List<Field> list = CollectionUtil.createArrayList();
        for (Field field : fields) {
            if (null != field.getAnnotation(annotationClass)) {
                list.add(field);
                field.setAccessible(true);
            }
        }

        return list.toArray(new Field[0]);
    }
691634
public static boolean classHasAnnotation(Class clazz, Class<? extends Annotation> annotation) {
		try {
			Set<Class> hierarchy = ReflectionUtil.flattenHierarchy(clazz);
			for (Class c : hierarchy) {
				if (c.isAnnotationPresent(annotation)) return true;
			}
		} catch (Throwable t) {
			t.printStackTrace();
		}
		return false;
	}
1202611
private Set<Annotation> getFieldAnnotations(final Class<?> clazz)
	{
		try
		{
			return new LinkedHashSet<Annotation>(asList(clazz.getDeclaredField(propertyName).getAnnotations()));
		}
		catch (final NoSuchFieldException e)
		{
			if (clazz.getSuperclass() != null)
			{
				return getFieldAnnotations(clazz.getSuperclass());
			}
			else
			{
				logger.debug("Cannot find propertyName: {}, declaring class: {}", propertyName, clazz);
				return new LinkedHashSet<Annotation>(0);
			}
		}
	}
1058925
private static boolean classHasRuntimeVisibleAnnotation(JavaClass cls) {
		AnnotationEntry[] annotations = cls.getAnnotationEntries();
		if (annotations != null) {
			for (AnnotationEntry annotation : annotations) {
				if (annotation.isRuntimeVisible()) {
					return true;
				}
			}
		}

		return false;
	}
1208529
public static List<Field> getColumns(Class<?> clazz)
			throws NoColumnAnnotationException {
		if(clazz == null) {
			throw new NoColumnAnnotationException("class is null");
		}
			
		List<Field> result = _getAnnotationColumns(clazz, Column.class);
		if (result.isEmpty()) {
			throw new NoColumnAnnotationException("class " + clazz.getName()
					+ " does not have any @Column fields");
		}
		
		return result;
	}
107030
public static boolean isAnnotationPresent(final Class<? extends Annotation> annotation, final Method method) {
        final Annotation e = DaemonScanner.getAnnotation(annotation, method);
        return e != null;
    }
947644
public static boolean hasMethodWithAnnotation(Class<?> type,
                                                  Class<? extends Annotation> annotationType,
                                                  boolean checkMetaAnnotations) {
        try {
            do {
                Method[] methods = type.getDeclaredMethods();
                for (Method method : methods) {
                    if (hasAnnotation(method, annotationType, checkMetaAnnotations)) {
                        return true;
                    }
                }
                type = type.getSuperclass();
            } while (type != null);
        } catch (Throwable e) {
            // ignore a class loading issue
        }
        return false;
    }
402474
public static boolean isBoolean( Class clazz ) {
      return clazz != null
            && (Boolean.TYPE.isAssignableFrom( clazz ) || Boolean.class.isAssignableFrom( clazz ));
   }