1
2
3
4
5
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
24
25
26 public class MulePropertyEditorRegistrar implements PropertyEditorRegistrar, MuleContextAware
27 {
28 private MuleContext muleContext;
29
30 public void setMuleContext(MuleContext context)
31 {
32 muleContext = context;
33 }
34
35 public void registerCustomEditors(PropertyEditorRegistry registry)
36 {
37 registry.registerCustomEditor(Connector.class, new ConnectorPropertyEditor(muleContext));
38 registry.registerCustomEditor(URIBuilder.class, new URIBuilderPropertyEditor(muleContext));
39 registry.registerCustomEditor(MessageExchangePattern.class,
40 new MessageExchangePatternPropertyEditor());
41 registry.registerCustomEditor(Type.class, new SimpleServiceTypePropertyEditor());
42 registry.registerCustomEditor(Date.class, new DatePropertyEditor(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"), new SimpleDateFormat("yyyy-MM-dd"), true));
43
44 }
45 }