Search in sources :

Example 1 with FieldProvider

use of org.b3log.latke.ioc.provider.FieldProvider in project latke by b3log.

the class BeanImpl method initFieldInjectionPoints.

/**
 * Initializes field injection points.
 */
private void initFieldInjectionPoints() {
    final Set<AnnotatedField<? super T>> annotatedFields = annotatedType.getFields();
    for (final AnnotatedField<? super T> annotatedField : annotatedFields) {
        final Field field = annotatedField.getJavaMember();
        if (field.getType().equals(Provider.class)) {
            // by provider
            final FieldProvider<T> provider = new FieldProvider<T>(beanManager, annotatedField);
            fieldProviders.add(provider);
            final FieldInjectionPoint fieldInjectionPoint = new FieldInjectionPoint(this, annotatedField);
            fieldInjectionPoints.add(fieldInjectionPoint);
        } else {
            // by qualifier
            final FieldInjectionPoint fieldInjectionPoint = new FieldInjectionPoint(this, annotatedField);
            fieldInjectionPoints.add(fieldInjectionPoint);
        }
    }
}
Also used : FieldProvider(org.b3log.latke.ioc.provider.FieldProvider) FieldInjectionPoint(org.b3log.latke.ioc.point.FieldInjectionPoint)

Aggregations

FieldInjectionPoint (org.b3log.latke.ioc.point.FieldInjectionPoint)1 FieldProvider (org.b3log.latke.ioc.provider.FieldProvider)1