Refine search
private boolean containsAnnotation(ClassInfo classInfo, DotName requiredAnnotationName, Class<? extends Annotation> requiredAnnotation) { // Type and members if (classInfo.annotations().containsKey(requiredAnnotationName)) { return true; } // Meta-annotations for (DotName annotation : classInfo.annotations().keySet()) { if (annotationClassAnnotationsCache.getValue(annotation).contains(requiredAnnotationName.toString())) { return true; } } // Superclass final DotName superName = classInfo.superName(); if (superName != null && !OBJECT_NAME.equals(superName)) { final ClassInfo superClassInfo = index.getClassByName(superName); if (superClassInfo == null) { // we are accessing a class that is outside of the jandex index // fallback to using reflection return Reflections.containsAnnotation(loadClass(superName.toString()), requiredAnnotation); } if (containsAnnotation(superClassInfo, requiredAnnotationName, requiredAnnotation)) { return true; } } return false; }
@Override public void cleanupAfterBoot() { if (annotationClassAnnotationsCache != null) { annotationClassAnnotationsCache.clear(); annotationClassAnnotationsCache = null; } index = null; }
public <T> void disposeBackedAnnotatedType(Class<T> rawType, String bdaId, String suffix) { TypeHolder<T> typeHolder = new TypeHolder<>(rawType, rawType, bdaId, suffix); BackedAnnotatedType<T> annotatedType = cast(this.backedAnnotatedTypes.getValueIfPresent(typeHolder)); if (annotatedType != null) { this.backedAnnotatedTypes.invalidate(typeHolder); this.slimAnnotatedTypesById.remove(annotatedType.getIdentifier()); this.enhancedAnnotatedTypes.invalidate(annotatedType); } }
public <X, A extends EnhancedAnnotatedMember<?, X, ? extends Member>> A loadEnhancedMember(AnnotatedMember<X> member, String bdaId) { if (member instanceof EnhancedAnnotatedMember<?, ?, ?>) { return Reflections.cast(member); } EnhancedAnnotatedType<X> declaringType = transformer.getEnhancedAnnotatedType(member.getDeclaringType(), bdaId); return enhancedMemberCache.getCastValue(new MemberKey<X, AnnotatedMember<X>>(declaringType, member)); }
@Override public void cleanupAfterBoot() { this.enhancedAnnotatedTypes.clear(); this.annotations.clear(); backedAnnotatedTypes.forEachValue((BackedAnnotatedType::clear)); this.backedAnnotatedTypes.clear(); }
public void vetoSpecializingBean(Bean<?> bean) { Set<? extends AbstractBean<?, ?>> noLongerSpecializedBeans = specializedBeans.getValueIfPresent(bean); if (noLongerSpecializedBeans != null) { specializedBeans.invalidate(bean); for (AbstractBean<?, ?> noLongerSpecializedBean : noLongerSpecializedBeans) { // We should never get null here but just to be sure AtomicLong count = specializedBeansMap.get(noLongerSpecializedBean); if (count != null) { count.decrementAndGet(); } } } }
/** * Gets a stereotype model * <p/> * Adds the model if it is not present. * * @param <T> The type * @param stereotype The stereotype * @return The stereotype model */ public <T extends Annotation> StereotypeModel<T> getStereotype(final Class<T> stereotype) { return stereotypes.getCastValue(stereotype); }
/** * removes all data for an annotation class. This should be called after an * annotation has been modified through the SPI */ public void clearAnnotationData(Class<? extends Annotation> annotationClass) { stereotypes.invalidate(annotationClass); scopes.invalidate(annotationClass); qualifiers.invalidate(annotationClass); interceptorBindings.invalidate(annotationClass); }
public boolean isCached(R resolvable) { return resolved.getValueIfPresent(wrap(resolvable)) != null; }
public <T> void disposeBackedAnnotatedType(Class<T> rawType, String bdaId, String suffix) { TypeHolder<T> typeHolder = new TypeHolder<>(rawType, rawType, bdaId, suffix); BackedAnnotatedType<T> annotatedType = cast(this.backedAnnotatedTypes.getValueIfPresent(typeHolder)); if (annotatedType != null) { this.backedAnnotatedTypes.invalidate(typeHolder); this.slimAnnotatedTypesById.remove(annotatedType.getIdentifier()); this.enhancedAnnotatedTypes.invalidate(annotatedType); } }
public <X, A extends EnhancedAnnotatedMember<?, X, ? extends Member>> A loadEnhancedMember(AnnotatedMember<X> member, String bdaId) { if (member instanceof EnhancedAnnotatedMember<?, ?, ?>) { return Reflections.cast(member); } EnhancedAnnotatedType<X> declaringType = transformer.getEnhancedAnnotatedType(member.getDeclaringType(), bdaId); return enhancedMemberCache.getCastValue(new MemberKey<X, AnnotatedMember<X>>(declaringType, member)); }
@Override public void cleanupAfterBoot() { this.enhancedAnnotatedTypes.clear(); this.annotations.clear(); backedAnnotatedTypes.forEachValue((BackedAnnotatedType::clear)); this.backedAnnotatedTypes.clear(); }
public void vetoSpecializingBean(Bean<?> bean) { Set<? extends AbstractBean<?, ?>> noLongerSpecializedBeans = specializedBeans.getValueIfPresent(bean); if (noLongerSpecializedBeans != null) { specializedBeans.invalidate(bean); for (AbstractBean<?, ?> noLongerSpecializedBean : noLongerSpecializedBeans) { // We should never get null here but just to be sure LongAdder count = specializedBeansMap.get(noLongerSpecializedBean); if (count != null) { count.decrement(); } } } }
/** * Gets a scope model * <p/> * Adds the model if it is not present. * * @param <T> The type * @param scope The scope type * @return The scope type model */ public <T extends Annotation> ScopeModel<T> getScopeModel(final Class<T> scope) { return scopes.getCastValue(scope); }
/** * removes all data for an annotation class. This should be called after an * annotation has been modified through the SPI */ public void clearAnnotationData(Class<? extends Annotation> annotationClass) { stereotypes.invalidate(annotationClass); scopes.invalidate(annotationClass); qualifiers.invalidate(annotationClass); interceptorBindings.invalidate(annotationClass); }
public boolean isCached(R resolvable) { return resolved.getValueIfPresent(wrap(resolvable)) != null; }