Interface Converter

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Class getType()
      Gets the the type of object supported by this converter.
      java.lang.Object toObject​(java.lang.String text)
      Converts the supplied text in to an instance of the editor type.
      java.lang.String toString​(java.lang.Object value)
      Converts the supplied object to text.
      • Methods inherited from interface java.beans.PropertyEditor

        addPropertyChangeListener, getAsText, getCustomEditor, getJavaInitializationString, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setAsText, setValue, supportsCustomEditor
    • Method Detail

      • getType

        java.lang.Class getType()
        Gets the the type of object supported by this converter.
        Returns:
        the type used for that converter.
      • toString

        java.lang.String toString​(java.lang.Object value)
                           throws PropertyEditorException
        Converts the supplied object to text. If value is null, null will be returned. If value is not an instance of the this converter's type, a PropertyEditorException will be thrown.
        Parameters:
        value - an instance of the editor type
        Returns:
        the text equivalent of the value
        Throws:
        PropertyEditorException - if an error occurs while converting the value to a String (this is very rare)
      • toObject

        java.lang.Object toObject​(java.lang.String text)
                           throws PropertyEditorException
        Converts the supplied text in to an instance of the editor type. If text is null, null will be returned.
        Parameters:
        text - the text to convert
        Returns:
        an instance of the editor type
        Throws:
        PropertyEditorException - if an error occurs while converting the text to an object