Clover icon

sunshower-base

  1. Project Clover database Fri Apr 6 2018 03:41:27 UTC
  2. Package io.sunshower.test.ws

File JAXRSPostProcessor.java

 

Coverage histogram

../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
8
5
1
38
30
5
0.62
1.6
5
1

Classes

Class Line # Actions
JAXRSPostProcessor 8 8 5
1.0100%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package io.sunshower.test.ws;
2   
3    import org.springframework.beans.BeansException;
4    import org.springframework.beans.factory.config.BeanPostProcessor;
5    import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
6    import org.springframework.util.ReflectionUtils;
7   
 
8    public class JAXRSPostProcessor implements BeanPostProcessor {
9   
10    private ConfigurableListableBeanFactory configurableBeanFactory;
11   
 
12  1 toggle public JAXRSPostProcessor(ConfigurableListableBeanFactory beanFactory) {
13  1 this.configurableBeanFactory = beanFactory;
14    }
15   
 
16  11 toggle @Override
17    public Object postProcessBeforeInitialization(Object bean, String beanName)
18    throws BeansException {
19  11 return bean;
20    }
21   
 
22  11 toggle @Override
23    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
24  11 this.scanDataAccessAnnotation(bean, beanName);
25  11 return bean;
26    }
27   
 
28  11 toggle protected void scanDataAccessAnnotation(Object bean, String beanName) {
29  11 this.configureFieldInjection(bean);
30    }
31   
 
32  11 toggle private void configureFieldInjection(Object bean) {
33  11 Class<?> managedBeanClass = bean.getClass();
34  11 ReflectionUtils.FieldCallback fieldCallback =
35    new JAXRSFieldCallback(configurableBeanFactory, bean);
36  11 ReflectionUtils.doWithFields(managedBeanClass, fieldCallback);
37    }
38    }