private boolean containsAnnotation(Annotation annotation, Class<? extends Annotation> requiredAnnotation, boolean checkMetaAnnotations) { Class<? extends Annotation> annotationType = annotation.annotationType(); if (requiredAnnotation.equals(annotationType)) { return true; } if (checkMetaAnnotations && containsAnnotation(cache.getAnnotations(annotationType), requiredAnnotation, false)) { return true; } return false; }
@Override public Set<Annotation> getAnnotations() { return reflectionCache.getBackedAnnotatedTypeAnnotationSet(javaClass); }
@Override public Set<Annotation> getAnnotations() { return getReflectionCache().getParameterAnnotationSet(this); }
protected void processMetaAnnotations(SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap, Annotation annotation, ClassTransformer classTransformer, boolean declared) { // WELD-1310 Include synthetic annotations SlimAnnotatedType<?> syntheticAnnotationAnnotatedType = classTransformer.getSyntheticAnnotationAnnotatedType(annotation.annotationType()); if (syntheticAnnotationAnnotatedType != null) { addMetaAnnotations(metaAnnotationMap, annotation, syntheticAnnotationAnnotatedType.getAnnotations(), declared); } else { addMetaAnnotations(metaAnnotationMap, annotation, classTransformer.getReflectionCache().getAnnotations(annotation.annotationType()), declared); ReflectionCache.AnnotationClass<?> annotationClass = classTransformer.getReflectionCache().getAnnotationClass(annotation.annotationType()); if (annotationClass.isRepeatableAnnotationContainer()) { processMetaAnnotations(metaAnnotationMap, annotationClass.getRepeatableAnnotations(annotation), classTransformer, declared); } } addMetaAnnotations(metaAnnotationMap, annotation, classTransformer.getTypeStore().get(annotation.annotationType()), declared); }
Class<? super T> superclass = annotatedType.getJavaClass().getSuperclass(); if (superclass == null) { this.superclass = null; } else { this.superclass = classTransformer.getEnhancedAnnotatedType(superclass, slim.getIdentifier().getBdaId()); this.superclass = classTransformer.getEnhancedAnnotatedType(Object.class, AnnotatedTypeIdentifier.NULL_BDA_ID); ArrayList<EnhancedAnnotatedField<?, ? super T>> declaredFieldsTemp = new ArrayList<EnhancedAnnotatedField<?, ? super T>>(); Class<T> javaClass = annotatedType.getJavaClass(); EnhancedAnnotatedType<?> interfaceType = classTransformer.getEnhancedAnnotatedType(interfaceClazz, slim.getIdentifier().getBdaId()); for (EnhancedAnnotatedMethod<?, ?> interfaceMethod : interfaceType.getEnhancedMethods()) { if(Reflections.isDefault(interfaceMethod.getJavaMember())) { if (syntheticAnnotationAnnotatedType == null) { addMetaAnnotations(declaredMetaAnnotationMap, declaredAnnotation, classTransformer.getReflectionCache() .getAnnotations(declaredAnnotation.annotationType()), true); } else { addMetaAnnotations(declaredMetaAnnotationMap, declaredAnnotation, addMetaAnnotations(declaredMetaAnnotationMap, declaredAnnotation, classTransformer.getTypeStore().get(declaredAnnotation.annotationType()), true); declaredMetaAnnotationMap.put(declaredAnnotation.annotationType(), declaredAnnotation);
public static <T> EnhancedAnnotatedType<T> of(SlimAnnotatedType<T> annotatedType, ClassTransformer classTransformer) { if (annotatedType instanceof BackedAnnotatedType<?>) { return new EnhancedAnnotatedTypeImpl<T>(annotatedType, buildAnnotationMap(annotatedType.getAnnotations()), buildAnnotationMap(classTransformer.getReflectionCache().getDeclaredAnnotations(annotatedType.getJavaClass())), classTransformer); } else { return new EnhancedAnnotatedTypeImpl<T>(annotatedType, buildAnnotationMap(annotatedType.getAnnotations()), buildAnnotationMap(annotatedType.getAnnotations()), classTransformer); } }
@Override public void addScope(Class<? extends Annotation> scopeType, boolean normal, boolean passivating) { checkWithinObserverNotification(); if (normal) { getTypeStore().add(scopeType, new NormalScopeLiteral(passivating)); } else if (passivating) { throw BootstrapLogger.LOG.passivatingNonNormalScopeIllegal(scopeType); } else { getTypeStore().add(scopeType, ScopeLiteral.INSTANCE); } getBeanManager().getServices().get(ClassTransformer.class).clearAnnotationData(scopeType); getBeanManager().getServices().get(MetaAnnotationStore.class).clearAnnotationData(scopeType); getBeanManager().getServices().get(ReflectionCache.class).cleanup(); BootstrapLogger.LOG.addScopeCalled(getReceiver(), scopeType); }
if (containsAnnotation(annotatedType.getAnnotations(), requiredAnnotation, true)) { return true; if (containsAnnotations(cache.getAnnotations(field), requiredAnnotation)) { return true; if (containsAnnotations(cache.getAnnotations(constructor), requiredAnnotation)) { return true; if (containsAnnotations(cache.getAnnotations(method), requiredAnnotation)) { return true; for (Method method : interfaceClazz.getDeclaredMethods()) { if (Reflections.isDefault(method)) { if (containsAnnotations(cache.getAnnotations(method), requiredAnnotation)) { return true;
@Override public Set<Annotation> getAnnotations() { return getReflectionCache().getAnnotations(parameter); }
if (containsAnnotations(annotatedType.getAnnotations(), requiredAnnotation, true)) { return true; if (containsAnnotations(cache.getAnnotations(field), requiredAnnotation)) { return true; if (containsAnnotations(cache.getAnnotations(constructor), requiredAnnotation)) { return true; if (containsAnnotations(cache.getAnnotations(method), requiredAnnotation)) { return true;
@Override public Set<Annotation> getAnnotations() { return getReflectionCache().getAnnotationSet(getAnnotatedElement()); } }
protected void processMetaAnnotations(SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap, Annotation annotation, ClassTransformer classTransformer, boolean declared) { // WELD-1310 Include synthetic annotations SlimAnnotatedType<?> syntheticAnnotationAnnotatedType = classTransformer.getSyntheticAnnotationAnnotatedType(annotation.annotationType()); if (syntheticAnnotationAnnotatedType != null) { addMetaAnnotations(metaAnnotationMap, annotation, syntheticAnnotationAnnotatedType.getAnnotations(), declared); } else { addMetaAnnotations(metaAnnotationMap, annotation, classTransformer.getReflectionCache().getAnnotations(annotation.annotationType()), declared); ReflectionCache.AnnotationClass<?> annotationClass = classTransformer.getReflectionCache().getAnnotationClass(annotation.annotationType()); if (annotationClass.isRepeatableAnnotationContainer()) { processMetaAnnotations(metaAnnotationMap, annotationClass.getRepeatableAnnotations(annotation), classTransformer, declared); } } addMetaAnnotations(metaAnnotationMap, annotation, classTransformer.getTypeStore().get(annotation.annotationType()), declared); }
public static <T> EnhancedAnnotatedType<T> of(SlimAnnotatedType<T> annotatedType, ClassTransformer classTransformer) { if (annotatedType instanceof BackedAnnotatedType<?>) { return new EnhancedAnnotatedTypeImpl<T>(annotatedType, buildAnnotationMap(annotatedType.getAnnotations()), buildAnnotationMap(classTransformer.getReflectionCache().getDeclaredAnnotations(annotatedType.getJavaClass())), classTransformer); } else { return new EnhancedAnnotatedTypeImpl<T>(annotatedType, buildAnnotationMap(annotatedType.getAnnotations()), buildAnnotationMap(annotatedType.getAnnotations()), classTransformer); } }
@Override public void addScope(Class<? extends Annotation> scopeType, boolean normal, boolean passivating) { checkWithinObserverNotification(); if (normal) { getTypeStore().add(scopeType, new NormalScopeLiteral(passivating)); } else if (passivating) { throw BootstrapLogger.LOG.passivatingNonNormalScopeIllegal(scopeType); } else { getTypeStore().add(scopeType, ScopeLiteral.INSTANCE); } getBeanManager().getServices().get(ClassTransformer.class).clearAnnotationData(scopeType); getBeanManager().getServices().get(MetaAnnotationStore.class).clearAnnotationData(scopeType); getBeanManager().getServices().get(ReflectionCache.class).cleanup(); BootstrapLogger.LOG.addScopeCalled(getReceiver(), scopeType); }
if (containsAnnotation(annotatedType.getAnnotations(), requiredAnnotation, true)) { return true; if (containsAnnotations(cache.getAnnotations(field), requiredAnnotation)) { return true; if (containsAnnotations(cache.getAnnotations(constructor), requiredAnnotation)) { return true; if (containsAnnotations(cache.getAnnotations(method), requiredAnnotation)) { return true; for (Method method : interfaceClazz.getDeclaredMethods()) { if (Reflections.isDefault(method)) { if (containsAnnotations(cache.getAnnotations(method), requiredAnnotation)) { return true;
@Override public Set<Annotation> getAnnotations() { return getReflectionCache().getAnnotations(parameter); }
protected void processMetaAnnotations(SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap, Annotation annotation, ClassTransformer classTransformer, boolean declared) { // WELD-1310 Include synthetic annotations SlimAnnotatedType<?> syntheticAnnotationAnnotatedType = classTransformer.getSyntheticAnnotationAnnotatedType(annotation.annotationType()); if (syntheticAnnotationAnnotatedType != null) { addMetaAnnotations(metaAnnotationMap, annotation, syntheticAnnotationAnnotatedType.getAnnotations(), declared); } else { addMetaAnnotations(metaAnnotationMap, annotation, classTransformer.getReflectionCache().getAnnotations(annotation.annotationType()), declared); ReflectionCache.AnnotationClass<?> annotationClass = classTransformer.getReflectionCache().getAnnotationClass(annotation.annotationType()); if (annotationClass.isRepeatableAnnotationContainer()) { processMetaAnnotations(metaAnnotationMap, annotationClass.getRepeatableAnnotations(annotation), classTransformer, declared); } } addMetaAnnotations(metaAnnotationMap, annotation, classTransformer.getTypeStore().get(annotation.annotationType()), declared); }
public static <T> EnhancedAnnotatedType<T> of(SlimAnnotatedType<T> annotatedType, ClassTransformer classTransformer) { if (annotatedType instanceof BackedAnnotatedType<?>) { return new EnhancedAnnotatedTypeImpl<T>(annotatedType, buildAnnotationMap(annotatedType.getAnnotations()), buildAnnotationMap(classTransformer.getReflectionCache().getDeclaredAnnotations(annotatedType.getJavaClass())), classTransformer); } else { return new EnhancedAnnotatedTypeImpl<T>(annotatedType, buildAnnotationMap(annotatedType.getAnnotations()), buildAnnotationMap(annotatedType.getAnnotations()), classTransformer); } }
@Override public void addScope(Class<? extends Annotation> scopeType, boolean normal, boolean passivating) { checkWithinObserverNotification(); if (normal) { getTypeStore().add(scopeType, new NormalScopeLiteral(passivating)); } else if (passivating) { throw BootstrapLogger.LOG.passivatingNonNormalScopeIllegal(scopeType); } else { getTypeStore().add(scopeType, ScopeLiteral.INSTANCE); } getBeanManager().getServices().get(ClassTransformer.class).clearAnnotationData(scopeType); getBeanManager().getServices().get(MetaAnnotationStore.class).clearAnnotationData(scopeType); getBeanManager().getServices().get(ReflectionCache.class).cleanup(); BootstrapLogger.LOG.addScopeCalled(getReceiver(), scopeType); }
if (containsAnnotation(annotatedType.getAnnotations(), requiredAnnotation, true)) { return true; if (containsAnnotations(cache.getAnnotations(field), requiredAnnotation)) { return true; if (containsAnnotations(cache.getAnnotations(constructor), requiredAnnotation)) { return true; if (containsAnnotations(cache.getAnnotations(method), requiredAnnotation)) { return true; for (Method method : interfaceClazz.getDeclaredMethods()) { if (Reflections.isDefault(method)) { if (containsAnnotations(cache.getAnnotations(method), requiredAnnotation)) { return true;