@Test public void testHasMetaAnnotationSpecified() { assertFalse(Reflections.hasBeanDefiningMetaAnnotationSpecified(new Annotation[] {}, NormalScope.class)); assertTrue(Reflections.hasBeanDefiningMetaAnnotationSpecified(new Annotation[] {NamedLiteral.DEFAULT, FooStereotype.LITERAL}, Stereotype.class)); assertFalse(Reflections.hasBeanDefiningMetaAnnotationSpecified(new Annotation[] {NamedLiteral.DEFAULT, FooStereotype.LITERAL}, NormalScope.class)); assertTrue(Reflections.hasBeanDefiningMetaAnnotationSpecified(new Annotation[] {NamedLiteral.DEFAULT, FooNormalScoped.LITERAL}, NormalScope.class)); }
public static boolean hasBeanDefiningMetaAnnotationSpecified(Annotation[] annotations, Class<? extends Annotation> metaAnnotationType) { for (Annotation annotation : annotations) { if (annotation.annotationType().isAnnotationPresent(metaAnnotationType)) { return true; } } return false; }
Reflections { public static boolean hasBeanDefiningMetaAnnotationSpecified(Annotation[] annotations, Class<? extends Annotation> metaAnnotationType) { for (Annotation annotation : annotations) { if (annotation.annotationType().isAnnotationPresent(metaAnnotationType)) { return true; } } return false; } }
Reflections { public static boolean hasBeanDefiningMetaAnnotationSpecified(Annotation[] annotations, Class<? extends Annotation> metaAnnotationType) { for (Annotation annotation : annotations) { if (annotation.annotationType().isAnnotationPresent(metaAnnotationType)) { return true; } } return false; } private  Reflections(); }
Reflections { public static boolean hasBeanDefiningMetaAnnotationSpecified(Annotation[] annotations, Class<? extends Annotation> metaAnnotationType) { for (Annotation annotation : annotations) { if (annotation.annotationType().isAnnotationPresent(metaAnnotationType)) { return true; } } return false; } private  Reflections(); static boolean containsAnnotation(Class<?> javaClass, Class<? extends Annotation> requiredAnnotation); @SuppressWarnings("unchecked") static T cast(Object obj); static boolean isClassLoadable(ResourceLoader resourceLoader, String className); static Class<T> loadClass(ResourceLoader resourceLoader, String className); static Class<T> classForName(ResourceLoader resourceLoader, String className); static boolean hasBeanDefiningMetaAnnotationSpecified(Annotation[] annotations, Class<? extends Annotation> metaAnnotationType); static boolean containsAnnotations(Annotation[] annotations, Class<? extends Annotation> requiredAnnotation); static boolean hasBeanDefiningAnnotation(Class<?> clazz, Set<Class<? extends Annotation>> initialBeanDefiningAnnotations); }
Reflections { public static boolean hasBeanDefiningMetaAnnotationSpecified(Annotation[] annotations, Class<? extends Annotation> metaAnnotationType) { for (Annotation annotation : annotations) { if (annotation.annotationType().isAnnotationPresent(metaAnnotationType)) { return true; } } return false; } private  Reflections(); static boolean containsAnnotation(Class<?> javaClass, Class<? extends Annotation> requiredAnnotation); @SuppressWarnings("unchecked") static T cast(Object obj); static boolean isClassLoadable(ResourceLoader resourceLoader, String className); static Class<T> loadClass(ResourceLoader resourceLoader, String className); static Class<T> classForName(ResourceLoader resourceLoader, String className); static boolean hasBeanDefiningMetaAnnotationSpecified(Annotation[] annotations, Class<? extends Annotation> metaAnnotationType); static boolean containsAnnotations(Annotation[] annotations, Class<? extends Annotation> requiredAnnotation); static boolean hasBeanDefiningAnnotation(Class<?> clazz, Set<Class<? extends Annotation>> initialBeanDefiningAnnotations); static final List<Class<? extends Annotation>> META_ANNOTATIONS; }