private boolean isCDIOSGiField(AnnotatedField<? super T> field) { if (field.isAnnotationPresent(Inject.class) && field.isAnnotationPresent( OSGiService.class)) { return true; } return false; }
private AnnotatedField<? super X> wrap(AnnotatedField<? super X> af) { if (af.isAnnotationPresent(Context.class)) { return new DelegateAnnotatedField<>(af); } else { return af; } }
private AnnotatedField<? super X> wrap(AnnotatedField<? super X> af) { if (af.isAnnotationPresent(Context.class)) { return new DelegateAnnotatedField<>(af); } else { return af; } }
Set<Type> getContextFieldTypes() { return replacedFields.stream() .filter(f -> f.isAnnotationPresent(Context.class) || f.isAnnotationPresent(ContextResolved.class)) .map(f -> f.getJavaMember().getAnnotatedType().getType()) .collect(toSet()); }
Set<Type> getContextFieldTypes() { return replacedFields.stream() .filter(f -> f.isAnnotationPresent(Context.class) || f.isAnnotationPresent(ContextResolved.class)) .map(f -> f.getJavaMember().getAnnotatedType().getType()) .collect(toSet()); }
/** * * @param beanManager * @param field * @return <code>true</code> if the given field is annotated with an EE resource annotation, <code>false</code> otherwise */ public static boolean isEEResourceProducerField(BeanManagerImpl beanManager, AnnotatedField<?> field) { EJBApiAbstraction ejbApiAbstraction = beanManager.getServices().get(EJBApiAbstraction.class); PersistenceApiAbstraction persistenceApiAbstraction = beanManager.getServices().get(PersistenceApiAbstraction.class); WSApiAbstraction wsApiAbstraction = beanManager.getServices().get(WSApiAbstraction.class); return field.isAnnotationPresent(ejbApiAbstraction.EJB_ANNOTATION_CLASS) || field.isAnnotationPresent(ejbApiAbstraction.RESOURCE_ANNOTATION_CLASS) || field.isAnnotationPresent(persistenceApiAbstraction.PERSISTENCE_UNIT_ANNOTATION_CLASS) || field.isAnnotationPresent(persistenceApiAbstraction.PERSISTENCE_CONTEXT_ANNOTATION_CLASS) || field.isAnnotationPresent(wsApiAbstraction.WEB_SERVICE_REF_ANNOTATION_CLASS); }
private static <T> boolean isApplicable(AnnotatedType<T> at) { if (isApplicable(at.getJavaClass())) { return true; } Set<AnnotatedField<? super T>> fields = at.getFields(); for (AnnotatedField<? super T> field : fields) { if (field.isAnnotationPresent(Configurable.class)) { return true; } } return false; }
private static <T> boolean isApplicable(AnnotatedType<T> at) { if (isApplicable(at.getJavaClass())) { return true; } Set<AnnotatedField<? super T>> fields = at.getFields(); for (AnnotatedField<? super T> field : fields) { if (field.isAnnotationPresent(Configurable.class)) { return true; } } return false; }
private static <T> boolean isApplicable(AnnotatedType<T> at) { if (isApplicable(at.getJavaClass())) { return true; } Set<AnnotatedField<? super T>> fields = at.getFields(); for (AnnotatedField<? super T> field : fields) { if (field.isAnnotationPresent(Configurable.class)) { return true; } } return false; }
InjectionPointImpl(Bean<?> ownerBean, Collection<Annotation> qualifiers, AnnotatedField<?> annotatedField) { this(ownerBean, annotatedField.getBaseType(), qualifiers, annotatedField, annotatedField.getJavaMember(), annotatedField.isAnnotationPresent(Delegate.class), annotatedField.getJavaMember() == null? false : Modifier.isTransient(annotatedField.getJavaMember().getModifiers())); }
private void validateManagedBean(AnnotatedType<Farm> type) { assert type.getBaseType().equals(Farm.class); assert rawTypeSetMatches(type.getTypeClosure(), Farm.class, Object.class); assert type.getFields().size() == 1; assert type.getFields().iterator().next().isAnnotationPresent(Produces.class); assert type.getMethods().size() == 1; assert type.getMethods().iterator().next().isAnnotationPresent(Produces.class); }
private void validateManagedBean(AnnotatedType<Farm> type) { assert type.getBaseType().equals(Farm.class); assert typeSetMatches(type.getTypeClosure(), Farm.class, Object.class); assert type.getFields().size() == 1; assert type.getFields().iterator().next().isAnnotationPresent(Produces.class); assert type.getMethods().size() == 1; assert type.getMethods().iterator().next().isAnnotationPresent(Produces.class); }
/** * * @param beanManager * @param field * @return <code>true</code> if the given field is annotated with an EE resource annotation, <code>false</code> otherwise */ public static boolean isEEResourceProducerField(BeanManagerImpl beanManager, AnnotatedField<?> field) { final ResourceInjectionFactory factory = beanManager.getServices().get(ResourceInjectionFactory.class); for (ResourceInjectionProcessor<?, ?> processor : factory) { if (field.isAnnotationPresent(processor.getMarkerAnnotation(beanManager))) { return true; } } return false; }
/** * * @param beanManager * @param field * @return <code>true</code> if the given field is annotated with an EE resource annotation, <code>false</code> otherwise */ public static boolean isEEResourceProducerField(BeanManagerImpl beanManager, AnnotatedField<?> field) { final ResourceInjectionFactory factory = beanManager.getServices().get(ResourceInjectionFactory.class); for (ResourceInjectionProcessor<?, ?> processor : factory) { if (field.isAnnotationPresent(processor.getMarkerAnnotation(beanManager))) { return true; } } return false; }
/** * * @param beanManager * @param field * @return <code>true</code> if the given field is annotated with an EE resource annotation, <code>false</code> otherwise */ public static boolean isEEResourceProducerField(BeanManagerImpl beanManager, AnnotatedField<?> field) { final ResourceInjectionFactory factory = beanManager.getServices().get(ResourceInjectionFactory.class); for (ResourceInjectionProcessor<?, ?> processor : factory) { if (field.isAnnotationPresent(processor.getMarkerAnnotation(beanManager))) { return true; } } return false; }
/** * * @param beanManager * @param field * @return <code>true</code> if the given field is annotated with an EE resource annotation, <code>false</code> otherwise */ public static boolean isEEResourceProducerField(BeanManagerImpl beanManager, AnnotatedField<?> field) { final ResourceInjectionFactory factory = beanManager.getServices().get(ResourceInjectionFactory.class); for (ResourceInjectionProcessor<?, ?> processor : factory) { if (field.isAnnotationPresent(processor.getMarkerAnnotation(beanManager))) { return true; } } return false; }
/** * * @param beanManager * @param field * @return <code>true</code> if the given field is annotated with an EE resource annotation, <code>false</code> otherwise */ public static boolean isEEResourceProducerField(BeanManagerImpl beanManager, AnnotatedField<?> field) { final ResourceInjectionFactory factory = beanManager.getServices().get(ResourceInjectionFactory.class); for (ResourceInjectionProcessor<?, ?> processor : factory) { if (field.isAnnotationPresent(processor.getMarkerAnnotation(beanManager))) { return true; } } return false; }
/** * @param fieldInjectionPoint * @param beanManager * @return {@link ResourceInjection} for static producer field or <code>null</code> if required services are not supported or the field is not annotated * with the specific marker annotation * @see StaticEEResourceProducerField */ protected <T, X> ResourceInjection<T> createStaticProducerFieldResourceInjection(FieldInjectionPoint<T, X> fieldInjectionPoint, BeanManagerImpl beanManager) { S injectionServices = getInjectionServices(beanManager); C processorContext = getProcessorContext(beanManager); if (injectionServices != null && fieldInjectionPoint.getAnnotated().isAnnotationPresent(getMarkerAnnotation(processorContext)) && accept(fieldInjectionPoint.getAnnotated(), processorContext)) { return createFieldResourceInjection(fieldInjectionPoint, injectionServices, processorContext); } return null; }
/** * @param fieldInjectionPoint * @param beanManager * @return {@link ResourceInjection} for static producer field or <code>null</code> if required services are not supported or the field is not annotated * with the specific marker annotation * @see StaticEEResourceProducerField */ protected <T, X> ResourceInjection<T> createStaticProducerFieldResourceInjection(FieldInjectionPoint<T, X> fieldInjectionPoint, BeanManagerImpl beanManager) { S injectionServices = getInjectionServices(beanManager); C processorContext = getProcessorContext(beanManager); if (injectionServices != null && fieldInjectionPoint.getAnnotated().isAnnotationPresent(getMarkerAnnotation(processorContext)) && accept(fieldInjectionPoint.getAnnotated(), processorContext)) { return createFieldResourceInjection(fieldInjectionPoint, injectionServices, processorContext); } return null; }
/** * @param fieldInjectionPoint * @param beanManager * @return {@link ResourceInjection} for static producer field or <code>null</code> if required services are not supported or the field is not annotated * with the specific marker annotation * @see StaticEEResourceProducerField */ protected <T, X> ResourceInjection<T> createStaticProducerFieldResourceInjection(FieldInjectionPoint<T, X> fieldInjectionPoint, BeanManagerImpl beanManager) { S injectionServices = getInjectionServices(beanManager); C processorContext = getProcessorContext(beanManager); if (injectionServices != null && fieldInjectionPoint.getAnnotated().isAnnotationPresent(getMarkerAnnotation(processorContext)) && accept(fieldInjectionPoint.getAnnotated(), processorContext)) { return createFieldResourceInjection(fieldInjectionPoint, injectionServices, processorContext); } return null; }