Mercurial > projects > dwt2
comparison org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/IConverter.d @ 78:0a55d2d5a946
Added file for databinding
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 14 Apr 2009 11:35:29 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
76:f05e6e8b2f2d | 78:0a55d2d5a946 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2005, 2008 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 *******************************************************************************/ | |
11 module org.eclipse.core.databinding.conversion.IConverter; | |
12 | |
13 import java.lang.all; | |
14 | |
15 /** | |
16 * A one-way converter. | |
17 * | |
18 * @noextend This interface is not intended to be extended by clients. | |
19 * @noimplement This interface is not intended to be implemented by clients. | |
20 * Clients should subclass {@link Converter}. | |
21 * | |
22 * @since 1.0 | |
23 * | |
24 */ | |
25 public interface IConverter { | |
26 | |
27 /** | |
28 * Returns the type whose instances can be converted by this converter. The | |
29 * return type is Object rather than Class to optionally support richer type | |
30 * systems than the one provided by Java reflection. | |
31 * | |
32 * @return the type whose instances can be converted, or null if this | |
33 * converter is untyped | |
34 */ | |
35 public Object getFromType(); | |
36 | |
37 /** | |
38 * Returns the type to which this converter can convert. The return type is | |
39 * Object rather than Class to optionally support richer type systems than | |
40 * the one provided by Java reflection. | |
41 * | |
42 * @return the type to which this converter can convert, or null if this | |
43 * converter is untyped | |
44 */ | |
45 public Object getToType(); | |
46 | |
47 /** | |
48 * Returns the result of the conversion of the given object. | |
49 * | |
50 * @param fromObject | |
51 * the object to convert, of type {@link #getFromType()} | |
52 * @return the converted object, of type {@link #getToType()} | |
53 */ | |
54 public Object convert(Object fromObject); | |
55 } |