78
|
1 /*
|
|
2 * Copyright cast(C) 2005 db4objects Inc. http://www.db4o.com
|
|
3 *
|
|
4 * All rights reserved. This program and the accompanying materials
|
|
5 * are made available under the terms of the Eclipse Public License v1.0
|
|
6 * which accompanies this distribution, and is available at
|
|
7 * http://www.eclipse.org/legal/epl-v10.html
|
|
8 *
|
|
9 * Contributors:
|
|
10 * db4objects - Initial API and implementation
|
|
11 */
|
|
12 module org.eclipse.core.internal.databinding.conversion.StringToDateConverter;
|
|
13
|
|
14 import java.lang.all;
|
|
15
|
|
16 import java.util.Date;
|
|
17
|
|
18 import org.eclipse.core.databinding.conversion.IConverter;
|
|
19
|
|
20
|
|
21 /**
|
|
22 * Convert a String to a java.util.Date, respecting the current locale
|
|
23 *
|
|
24 * @since 1.0
|
|
25 */
|
|
26 public class StringToDateConverter : DateConversionSupport , IConverter {
|
|
27 public Object convert(Object source) {
|
|
28 return parse(source.toString());
|
|
29 }
|
|
30
|
|
31 public Object getFromType() {
|
|
32 return String.classinfo;
|
|
33 }
|
|
34
|
|
35 public Object getToType() {
|
|
36 return Date.classinfo;
|
|
37 }
|
|
38 }
|