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  
  * $Id: MulePropertyEditorRegistrar.java 19980 2010-10-21 11:27:14Z rossmason $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.config.spring.editors;
 12  
 
 13  
 import org.mule.MessageExchangePattern;
 14  
 import org.mule.api.MuleContext;
 15  
 import org.mule.api.context.MuleContextAware;
 16  
 import org.mule.api.transport.Connector;
 17  
 import org.mule.construct.SimpleService.Type;
 18  
 import org.mule.endpoint.URIBuilder;
 19  
 
 20  
 import java.text.SimpleDateFormat;
 21  
 import java.util.Date;
 22  
 
 23  
 import org.springframework.beans.PropertyEditorRegistrar;
 24  
 import org.springframework.beans.PropertyEditorRegistry;
 25  
 
 26  
 /**
 27  
  * The preferred way to configure property editors in Spring 2/3 is to implement a
 28  
  * registrar
 29  
  */
 30  0
 public class MulePropertyEditorRegistrar implements PropertyEditorRegistrar, MuleContextAware
 31  
 {
 32  
     private MuleContext muleContext;
 33  
 
 34  
     public void setMuleContext(MuleContext context)
 35  
     {
 36  0
         muleContext = context;
 37  0
     }
 38  
 
 39  
     public void registerCustomEditors(PropertyEditorRegistry registry)
 40  
     {
 41  0
         registry.registerCustomEditor(Connector.class, new ConnectorPropertyEditor(muleContext));
 42  0
         registry.registerCustomEditor(URIBuilder.class, new URIBuilderPropertyEditor(muleContext));
 43  0
         registry.registerCustomEditor(MessageExchangePattern.class,
 44  
             new MessageExchangePatternPropertyEditor());
 45  0
         registry.registerCustomEditor(Type.class, new SimpleServiceTypePropertyEditor());
 46  0
         registry.registerCustomEditor(Date.class, new DatePropertyEditor(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"), new SimpleDateFormat("yyyy-MM-dd"), false));
 47  
 
 48  0
     }
 49  
 }