1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
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 | |
|
28 | |
|
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 | |
} |