Coverage Report - org.mule.config.spring.editors.MulePropertyEditorRegistrar
 
Classes in this File Line Coverage Branch Coverage Complexity
MulePropertyEditorRegistrar
0%
0/9
N/A
1
 
 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.config.spring.editors;
 8  
 
 9  
 import org.mule.MessageExchangePattern;
 10  
 import org.mule.api.MuleContext;
 11  
 import org.mule.api.context.MuleContextAware;
 12  
 import org.mule.api.transport.Connector;
 13  
 import org.mule.construct.SimpleService.Type;
 14  
 import org.mule.endpoint.URIBuilder;
 15  
 
 16  
 import java.text.SimpleDateFormat;
 17  
 import java.util.Date;
 18  
 
 19  
 import org.springframework.beans.PropertyEditorRegistrar;
 20  
 import org.springframework.beans.PropertyEditorRegistry;
 21  
 
 22  
 /**
 23  
  * The preferred way to configure property editors in Spring 2/3 is to implement a
 24  
  * registrar
 25  
  */
 26  0
 public class MulePropertyEditorRegistrar implements PropertyEditorRegistrar, MuleContextAware
 27  
 {
 28  
     private MuleContext muleContext;
 29  
 
 30  
     public void setMuleContext(MuleContext context)
 31  
     {
 32  0
         muleContext = context;
 33  0
     }
 34  
 
 35  
     public void registerCustomEditors(PropertyEditorRegistry registry)
 36  
     {
 37  0
         registry.registerCustomEditor(Connector.class, new ConnectorPropertyEditor(muleContext));
 38  0
         registry.registerCustomEditor(URIBuilder.class, new URIBuilderPropertyEditor(muleContext));
 39  0
         registry.registerCustomEditor(MessageExchangePattern.class,
 40  
             new MessageExchangePatternPropertyEditor());
 41  0
         registry.registerCustomEditor(Type.class, new SimpleServiceTypePropertyEditor());
 42  0
         registry.registerCustomEditor(Date.class, new DatePropertyEditor(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"), new SimpleDateFormat("yyyy-MM-dd"), true));
 43  
 
 44  0
     }
 45  
 }