KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > internal > databinding > provisional > conversion > ConvertString2Date


1 /*
2  * Copyright (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 package org.eclipse.jface.internal.databinding.provisional.conversion;
13
14 import java.util.Date JavaDoc;
15
16
17 /**
18  * Convert a String to a java.util.Date, respecting the current locale
19  *
20  * @since 1.0
21  */

22 public class ConvertString2Date extends DateConversionSupport implements IConverter {
23     public Object JavaDoc convert(Object JavaDoc source) {
24         return parse(source.toString());
25     }
26
27     public Object JavaDoc getFromType() {
28         return String JavaDoc.class;
29     }
30
31     public Object JavaDoc getToType() {
32         return Date JavaDoc.class;
33     }
34 }
35
Popular Tags