Mercurial > projects > dwt2
annotate org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToDateConverter.d @ 88:9e0ab372d5d8
Revert from TypeInfo/ClassInfo to java.lang.Class
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 19 Apr 2009 11:10:09 +0200 |
parents | 6be48cf9f95c |
children |
rev | line source |
---|---|
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; | |
81 | 13 import org.eclipse.core.internal.databinding.conversion.DateConversionSupport; |
78 | 14 |
15 import java.lang.all; | |
16 | |
17 import java.util.Date; | |
18 | |
19 import org.eclipse.core.databinding.conversion.IConverter; | |
20 | |
21 | |
22 /** | |
23 * Convert a String to a java.util.Date, respecting the current locale | |
24 * | |
25 * @since 1.0 | |
26 */ | |
27 public class StringToDateConverter : DateConversionSupport , IConverter { | |
28 public Object convert(Object source) { | |
29 return parse(source.toString()); | |
30 } | |
31 | |
32 public Object getFromType() { | |
88
9e0ab372d5d8
Revert from TypeInfo/ClassInfo to java.lang.Class
Frank Benoit <benoit@tionex.de>
parents:
85
diff
changeset
|
33 return Class.fromType!(StringCls); |
78 | 34 } |
35 | |
36 public Object getToType() { | |
88
9e0ab372d5d8
Revert from TypeInfo/ClassInfo to java.lang.Class
Frank Benoit <benoit@tionex.de>
parents:
85
diff
changeset
|
37 return Class.fromType!(Date); |
78 | 38 } |
39 } |