10 Eylül 2018 Pazartesi

SpringContext AutowiredAnnotationBeanPostProcessor Sınıfı

Örnek
Şöyle yaparız.
@SuppressWarnings("unchecked")
public AutowiredAnnotationBeanPostProcessor() {
  this.autowiredAnnotationTypes.add(Autowired.class);
  this.autowiredAnnotationTypes.add(Value.class);
  try {
    this.autowiredAnnotationTypes.add((Class<? extends Annotation>)
      ClassUtils.forName("javax.inject.Inject",
        AutowiredAnnotationBeanPostProcessor.class.getClassLoader()));
      logger.info("JSR-330 'javax.inject.Inject' annotation found and supported for
                   autowiring");
    }
    catch (ClassNotFoundException ex) {
        // JSR-330 API not available - simply skip.
    }
}

Hiç yorum yok:

Yorum Gönder