Coverage Report - org.kuali.spring.util.event.DefaultVisitListener
 
Classes in this File Line Coverage Branch Coverage Complexity
DefaultVisitListener
87%
14/16
50%
2/4
1.4
 
 1  
 package org.kuali.spring.util.event;
 2  
 
 3  
 import org.slf4j.Logger;
 4  
 import org.slf4j.LoggerFactory;
 5  
 import org.springframework.util.ObjectUtils;
 6  
 
 7  1
 public class DefaultVisitListener implements VisitListener {
 8  1
         final Logger logger = LoggerFactory.getLogger(DefaultVisitListener.class);
 9  
 
 10  
         @Override
 11  
         public void valueResolved(ValueResolutionEvent event) {
 12  12
                 if (ObjectUtils.nullSafeEquals(event.getOldValue(), event.getNewValue())) {
 13  
                         // Nothing changed
 14  12
                         logger.trace("Resolved value is the same as the original value");
 15  
                 } else {
 16  
                         // The property was updated
 17  0
                         logger.trace("Value updated: [{}]->[{}]", event.getOldValue(), event.getNewValue());
 18  
                 }
 19  12
         }
 20  
 
 21  
         @Override
 22  
         public void beforeVisit(BeanVisitEvent event) {
 23  13
                 logger.info("Visiting {}", event.getBeanDefinition());
 24  13
         }
 25  
 
 26  
         @Override
 27  
         public void afterVisit(BeanVisitEvent event) {
 28  13
                 logger.trace("Visit completed. {}", event.getBeanDefinition());
 29  13
         }
 30  
 
 31  
         @Override
 32  
         public void beforeVisit(PropertyValueVisitEvent event) {
 33  12
                 logger.trace("Visiting {}", event.getPropertyValue());
 34  12
         }
 35  
 
 36  
         @Override
 37  
         public void afterVisit(PropertyValueVisitEvent event) {
 38  12
                 if (ObjectUtils.nullSafeEquals(event.getOldValue(), event.getNewValue())) {
 39  12
                         logger.trace("Value for property '{}' was left unchanged", event.getPropertyValue().getName());
 40  
                 } else {
 41  0
                         logger.info(event.getPropertyValue() + " updated [{}]->[{}]", event.getOldValue(), event.getNewValue());
 42  
                 }
 43  12
         }
 44  
 }