1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.config.spring.editors; |
8 | |
|
9 | |
import org.mule.api.MuleContext; |
10 | |
import org.mule.api.endpoint.EndpointException; |
11 | |
import org.mule.endpoint.MuleEndpointURI; |
12 | |
|
13 | |
import java.beans.PropertyEditorSupport; |
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
public class EndpointURIPropertyEditor extends PropertyEditorSupport |
20 | |
{ |
21 | |
private MuleContext muleContext; |
22 | |
|
23 | |
public EndpointURIPropertyEditor(MuleContext muleContext) |
24 | 0 | { |
25 | 0 | this.muleContext = muleContext; |
26 | 0 | } |
27 | |
|
28 | |
public void setAsText(String text) |
29 | |
{ |
30 | |
try |
31 | |
{ |
32 | 0 | setValue(new MuleEndpointURI(text, muleContext)); |
33 | |
} |
34 | 0 | catch (EndpointException e) |
35 | |
{ |
36 | 0 | throw new IllegalArgumentException(e.getMessage()); |
37 | 0 | } |
38 | 0 | } |
39 | |
|
40 | |
} |