Eclipse Platform
Release 3.3

org.eclipse.core.databinding.conversion
Interface IConverter

All Known Implementing Classes:
Converter

public interface IConverter

A one-way converter. This interface is not intended to be implemented by clients; clients should subclass Converter.

Since:
1.0

Method Summary
 Object convert(Object fromObject)
          Returns the result of the conversion of the given object.
 Object getFromType()
          Returns the type whose instances can be converted by this converter.
 Object getToType()
          Returns the type to which this converter can convert.
 

Method Detail

getFromType

public Object getFromType()
Returns the type whose instances can be converted by this converter. The return type is Object rather than Class to optionally support richer type systems than the one provided by Java reflection.

Returns:
the type whose instances can be converted, or null if this converter is untyped

getToType

public Object getToType()
Returns the type to which this converter can convert. The return type is Object rather than Class to optionally support richer type systems than the one provided by Java reflection.

Returns:
the type to which this converter can convert, or null if this converter is untyped

convert

public Object convert(Object fromObject)
Returns the result of the conversion of the given object.

Parameters:
fromObject - the object to convert, of type getFromType()
Returns:
the converted object, of type getToType()

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.