Coverage Report - org.mule.module.json.config.MapperFactoryBean
 
Classes in this File Line Coverage Branch Coverage Complexity
MapperFactoryBean
0%
0/14
0%
0/4
0
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.module.json.config;
 8  
 
 9  
 import org.codehaus.jackson.map.ObjectMapper;
 10  
 import org.springframework.beans.factory.config.AbstractFactoryBean;
 11  
 
 12  
 import java.util.Map;
 13  
 
 14  
 /**
 15  
  * TODO
 16  
  */
 17  0
 public class MapperFactoryBean extends AbstractFactoryBean<ObjectMapper>
 18  
 {
 19  
     private String name;
 20  
     private Map<Class<?>, Class<?>> mixins;
 21  
 
 22  
     @Override
 23  
     public Class<?> getObjectType()
 24  
     {
 25  0
         return ObjectMapper.class;
 26  
     }
 27  
 
 28  
     @Override
 29  
     protected ObjectMapper createInstance() throws Exception
 30  
     {
 31  0
         ObjectMapper mapper = new ObjectMapper();
 32  0
         if(mixins!=null)
 33  
         {
 34  0
             for (Map.Entry<Class<?>, Class<?>> entry : mixins.entrySet())
 35  
             {
 36  0
                 mapper.getSerializationConfig().addMixInAnnotations(entry.getKey(), entry.getValue());
 37  0
                 mapper.getDeserializationConfig().addMixInAnnotations(entry.getKey(), entry.getValue());
 38  
             }
 39  
         }
 40  0
         return mapper;
 41  
     }
 42  
 
 43  
     public Map<Class<?>, Class<?>> getMixins()
 44  
     {
 45  0
         return mixins;
 46  
     }
 47  
 
 48  
     public void setMixins(Map<Class<?>, Class<?>> mixins)
 49  
     {
 50  0
         this.mixins = mixins;
 51  0
     }
 52  
 
 53  
     public String getName()
 54  
     {
 55  0
         return name;
 56  
     }
 57  
 
 58  
     public void setName(String name)
 59  
     {
 60  0
         this.name = name;
 61  0
     }
 62  
 }