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 | 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 | |
} |