@Override public boolean isAnnotationPresent(final Class<? extends Annotation> annotationType) { return annotatedType.isAnnotationPresent(annotationType); } });
/** * Determines if annotation is present. * * @param annotationType Annotation type. * @return Outcome of test. */ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { return CommandBinding.class.equals(annotationType) || delegate.isAnnotationPresent(annotationType); } }
/** * Gather Application or resource classes to start. * * @param pit injection target * @param <T> any type */ @SuppressWarnings("unchecked") public <T> void gatherApplications(@Observes ProcessInjectionTarget<T> pit) { AnnotatedType<T> at = pit.getAnnotatedType(); if (!at.isAnnotationPresent(ApplicationScoped.class)) { return; } // class is annotated, let's make sure it is an application Class<?> theClass = at.getJavaClass(); if (Application.class.isAssignableFrom(theClass)) { this.applications.add((Class<? extends Application>) theClass); } else { // still may be a jax-rs resource (with no application attached) if (at.isAnnotationPresent(Path.class)) { this.resourceClasses.add(theClass); } } }
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { return delegate.isAnnotationPresent(annotationType); } }
@Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { return wrappedType.isAnnotationPresent( annotationType ); }
/** * Set a default scope for each CDI bean which is a JAX-RS Provider. * * @param <T> type * @param event event * @param beanManager bean manager */ public <T> void observeProviders(@WithAnnotations({Provider.class}) @Observes ProcessAnnotatedType<T> event, BeanManager beanManager) { setBeanManager(beanManager); AnnotatedType<T> annotatedType = event.getAnnotatedType(); if(!annotatedType.getJavaClass().isInterface() && !isSessionBean(annotatedType) // This check is redundant for CDI 1.1 containers but required for CDI 1.0 && annotatedType.isAnnotationPresent(Provider.class)) { LogMessages.LOGGER.debug(Messages.MESSAGES.discoveredCDIBeanJaxRsProvider(annotatedType.getJavaClass().getCanonicalName())); event.setAnnotatedType(wrapAnnotatedType(annotatedType, applicationScopedLiteral)); this.providers.add(annotatedType.getJavaClass()); } }
/** * Set a default scope for each CDI bean which is a JAX-RS Resource. * * @param <T> type * @param event event * @param beanManager bean manager */ public <T> void observeResources(@WithAnnotations({Path.class}) @Observes ProcessAnnotatedType<T> event, BeanManager beanManager) { setBeanManager(beanManager); AnnotatedType<T> annotatedType = event.getAnnotatedType(); if(!annotatedType.getJavaClass().isInterface() && !isSessionBean(annotatedType) // This check is redundant for CDI 1.1 containers but required for CDI 1.0 && GetRestful.isRootResource(annotatedType.getJavaClass()) && !annotatedType.isAnnotationPresent(Decorator.class)) { LogMessages.LOGGER.debug(Messages.MESSAGES.discoveredCDIBeanJaxRsResource(annotatedType.getJavaClass().getCanonicalName())); event.setAnnotatedType(wrapAnnotatedType(annotatedType, requestScopedLiteral)); this.resources.add(annotatedType.getJavaClass()); } }
@Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { if (annotationType == Vetoed.class) { return false; } return annotatedType.isAnnotationPresent(annotationType); }
@Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { if (annotationType == Vetoed.class) { return false; } return annotatedType.isAnnotationPresent(annotationType); }
@Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { if (annotationType == Vetoed.class) { return false; } return annotatedType.isAnnotationPresent(annotationType); }
/** * @return <code>true</code> if this AnnotatedType represents a CDI Interceptor * defined via a {@link javax.interceptor.Interceptor} annotation */ public static boolean isCdiInterceptor(AnnotatedType<?> annotatedType) { return annotatedType.isAnnotationPresent(javax.interceptor.Interceptor.class); }
@Override public boolean isAnnotationPresent(Class<? extends Annotation> aClass) { return original.isAnnotationPresent(aClass); }
@Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { if (annotationType == Vetoed.class) { return false; } return annotatedType.isAnnotationPresent(annotationType); }
@Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { return getAnnotation(annotationType) != null; } }
public static boolean isVetoed(AnnotatedType<?> type) { if (type.isAnnotationPresent(Vetoed.class)) { return true; } return isPackageVetoed(type.getJavaClass().getPackage()); }
public static boolean isVetoed(AnnotatedType<?> type) { if (type.isAnnotationPresent(Vetoed.class)) { return true; } return isPackageVetoed(type.getJavaClass().getPackage()); }
void detectInterfaces(@Observes ProcessAnnotatedType<?> event, BeanManager beanManager) { AnnotatedType<?> type = event.getAnnotatedType(); if (type.isAnnotationPresent(MessageLogger.class)) { messageLoggerTypes.add(type); } }
private <A extends Annotation> void addSyntheticAnnotation(AnnotatedType<A> annotation, Annotation requiredMetaAnnotation) { if (requiredMetaAnnotation != null && !annotation.isAnnotationPresent(requiredMetaAnnotation.annotationType())) { // Add required meta annotation annotation = new AnnotatedTypeWrapper<A>(annotation, requiredMetaAnnotation); } getBeanManager().getServices().get(ClassTransformer.class).addSyntheticAnnotation(annotation, getBeanManager().getId()); getBeanManager().getServices().get(MetaAnnotationStore.class).clearAnnotationData(annotation.getJavaClass()); }
private <A extends Annotation> void addSyntheticAnnotation(AnnotatedType<A> annotation, Annotation requiredMetaAnnotation) { if (requiredMetaAnnotation != null && !annotation.isAnnotationPresent(requiredMetaAnnotation.annotationType())) { // Add required meta annotation annotation = new AnnotatedTypeWrapper<A>(annotation, requiredMetaAnnotation); } getBeanManager().getServices().get(ClassTransformer.class).addSyntheticAnnotation(annotation, getBeanManager().getId()); getBeanManager().getServices().get(MetaAnnotationStore.class).clearAnnotationData(annotation.getJavaClass()); }
private <A extends Annotation> void addSyntheticAnnotation(AnnotatedType<A> annotation, Annotation requiredMetaAnnotation) { if (requiredMetaAnnotation != null && !annotation.isAnnotationPresent(requiredMetaAnnotation.annotationType())) { // Add required meta annotation annotation = new AnnotatedTypeWrapper<A>(annotation, requiredMetaAnnotation); } getBeanManager().getServices().get(ClassTransformer.class).addSyntheticAnnotation(annotation, getBeanManager().getId()); getBeanManager().getServices().get(MetaAnnotationStore.class).clearAnnotationData(annotation.getJavaClass()); } }