@Override public Set<Annotation> getAnnotations() { return annotatedType.getAnnotations(); }
/** * Constructor. * * @param delegate Type delegate. */ public InterceptorBindingAnnotatedType(AnnotatedType<T> delegate) { this.delegate = delegate; annotations = new HashSet<>(delegate.getAnnotations()); annotations.add(LiteralCommandBinding.getInstance()); }
@Override public Set<Annotation> getAnnotations() { return wrappedType.getAnnotations(); }
public JaxrsAnnotatedType(final AnnotatedType<TYPE> delegate, final Annotation scope) { this.delegate = delegate; this.annotations.addAll(delegate.getAnnotations()); this.annotations.add(scope); }
private boolean isSessionBean(AnnotatedType<?> annotatedType) { for (Annotation annotation : annotatedType.getAnnotations()) { Class<?> annotationType = annotation.annotationType(); if (annotationType.getName().equals(JAVAX_EJB_STATELESS) || annotationType.getName().equals(JAVAX_EJB_SINGLETON)) { LogMessages.LOGGER.debug(Messages.MESSAGES.beanIsSLSBOrSingleton(annotatedType.getJavaClass())); return true; // Do not modify scopes of SLSBs and Singletons } } return false; }
/** * Find out if a given annotated type is explicitly bound to a scope. * * @param annotatedType annotated type * @param manager bean manager * @return true if and only if a given annotated type is annotated with a scope * annotation or with a stereotype which (transitively) declares a * scope */ public static boolean isScopeDefined(AnnotatedType<?> annotatedType, BeanManager manager) { for (Annotation annotation : annotatedType.getAnnotations()) { if (manager.isScope(annotation.annotationType())) { return true; } if (manager.isStereotype(annotation.annotationType())) { if (isScopeDefined(annotation.annotationType(), manager)) { return true; } } } return false; }
public JaxrsAnnotatedType(AnnotatedType<TYPE> delegate, Annotation scope) { this.delegate = delegate; this.annotations.addAll(delegate.getAnnotations()); this.annotations.add(scope); }
public HystrixInterceptorBindingAnnotatedType(AnnotatedType<T> delegate) { this.delegate = delegate; annotations = new HashSet<>(delegate.getAnnotations()); annotations.add(HystrixCommandBinding.Literal.INSTANCE); }
public BValAnnotatedType(final AnnotatedType<A> annotatedType) { delegate = annotatedType; annotations = new HashSet<>(annotatedType.getAnnotations()); annotations.add(BValBindingLiteral.INSTANCE); }
@Override public Set<Annotation> getAnnotations() { Set<Annotation> annotations = new HashSet<Annotation>(); for (Annotation a : annotatedType.getAnnotations()) { if (a.annotationType() != Vetoed.class) { annotations.add(a); } } return annotations; }
public TideAnnotatedType(AnnotatedType<T> annotatedType, boolean component, boolean bean) { this.annotatedType = annotatedType; annotations = new HashSet<Annotation>(annotatedType.getAnnotations()); if (component) annotations.add(componentQualifier); if (bean) annotations.add(beanQualifier); }
@Override public Set<Annotation> getAnnotations() { Set<Annotation> annotations = new HashSet<Annotation>(); for (Annotation a : annotatedType.getAnnotations()) { if (a.annotationType() != Vetoed.class) { annotations.add(a); } } return annotations; }
public static Class<? extends Annotation> getBeanDefiningAnnotationScope(AnnotatedType<?> annotatedType) { for (Annotation annotation : annotatedType.getAnnotations()) { if (annotation.annotationType().isAnnotationPresent(NormalScope.class) || annotation.annotationType().equals(Dependent.class)) { return annotation.annotationType(); } } return null; }
/** * Construct the wrapper. */ public PortletSessionScopedAnnotatedType(AnnotatedType<SessionScoped> type) { aType = type; annos.addAll(type.getAnnotations()); annos.remove(Dummy.class.getAnnotation(SessionScoped.class)); annos.add(Dummy.class.getAnnotation(PortletSessionScoped.class)); }
public static Class<? extends Annotation> getBeanDefiningAnnotationScope(AnnotatedType<?> annotatedType) { for (Annotation annotation : annotatedType.getAnnotations()) { if (annotation.annotationType().isAnnotationPresent(NormalScope.class) || annotation.annotationType().equals(Dependent.class)) { return annotation.annotationType(); } } return null; }
public static Class<? extends Annotation> getBeanDefiningAnnotationScope(AnnotatedType<?> annotatedType) { for (Annotation annotation : annotatedType.getAnnotations()) { if (annotation.annotationType().isAnnotationPresent(NormalScope.class) || annotation.annotationType().equals(Dependent.class)) { return annotation.annotationType(); } } return null; }
private DelegateAnnotatedField(AnnotatedField<Y> delegate) { this.original = delegate; this.annotationSet = processAnnotations(delegate.getAnnotations()); }
<T> void rewriteTestClassScope(@Observes ProcessAnnotatedType<T> pat, BeanManager beanManager) { AnnotatedType<T> annotatedType = pat.getAnnotatedType(); if (annotatedType.getJavaClass().equals(testClass)) { // Replace any test class's scope with @Singleton Set<Annotation> annotations = annotatedType.getAnnotations().stream() .filter(annotation -> beanManager.isScope(annotation.annotationType())) .collect(Collectors.toSet()); annotations.add(SINGLETON_LITERAL); pat.setAnnotatedType(new AnnotationRewritingAnnotatedType<>(annotatedType, annotations)); } }
public AnnotatedTypeWrapper(AnnotatedType<T> delegate, boolean keepOriginalAnnotations, Annotation... additionalAnnotations) { this.delegate = delegate; ImmutableSet.Builder<Annotation> builder = ImmutableSet.<Annotation> builder(); if (keepOriginalAnnotations) { builder.addAll(delegate.getAnnotations()); } for (Annotation annotation : additionalAnnotations) { builder.add(annotation); } this.annotations = builder.build(); }
public AnnotatedTypeWrapper(AnnotatedType<T> delegate, boolean keepOriginalAnnotations, Annotation... additionalAnnotations) { this.delegate = delegate; ImmutableSet.Builder<Annotation> builder = ImmutableSet.<Annotation> builder(); if (keepOriginalAnnotations) { builder.addAll(delegate.getAnnotations()); } for (Annotation annotation : additionalAnnotations) { builder.add(annotation); } this.annotations = builder.build(); }