Class Converter<F,​T>

  • Type Parameters:
    F - type of the source value
    T - type of the converted value
    All Implemented Interfaces:
    IConverter<F,​T>
    Direct Known Subclasses:
    org.eclipse.core.internal.databinding.conversion.AbstractNumberToStringConverter, org.eclipse.core.internal.databinding.validation.NumberFormatConverter

    public abstract class Converter<F,​T>
    extends java.lang.Object
    implements IConverter<F,​T>
    Abstract base class for converters.
    Since:
    1.0
    Implementation Note:
    If methods are added to the interface which this class implements then implementations of those methods must be added to this class.
    • Constructor Summary

      Constructors 
      Constructor Description
      Converter​(java.lang.Object fromType, java.lang.Object toType)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getFromType()
      Returns the type whose instances can be converted by this converter.
      java.lang.Object getToType()
      Returns the type to which this converter can convert.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.eclipse.core.databinding.conversion.IConverter

        convert
    • Constructor Detail

      • Converter

        public Converter​(java.lang.Object fromType,
                         java.lang.Object toType)
        Parameters:
        fromType - type of source values
        toType - type of converted values
    • Method Detail

      • getFromType

        public java.lang.Object getFromType()
        Description copied from interface: IConverter
        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.
        Specified by:
        getFromType in interface IConverter<F,​T>
        Returns:
        the type whose instances can be converted, or null if this converter is untyped
      • getToType

        public java.lang.Object getToType()
        Description copied from interface: IConverter
        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.
        Specified by:
        getToType in interface IConverter<F,​T>
        Returns:
        the type to which this converter can convert, or null if this converter is untyped