Child pages
  • Providing Converters and Validators from Plugins

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

Note that IColumnConverter is considered to be deprecated, therefore in getColumnConverters() method do return an ITypedColumnConverter array.

A column converter class implementing the ITypedColumnConverter interface has to implement the following three methods that will be displayed in the Conversion tag:

  • convertFromObject()
    Converts from dataprovider value to db value

  • convertToObject()
    Converts from db value to dataprovider value

  • getToObjectType(one of TEXT, INTEGER, NUMBER, DATETIME or MEDIA)
    The dataprovider data type (so the resulting type of the convertToObject()).
    This type can be provided by using the IColumnTypes constants.

A column converter class can also define properties in the getDefaultProperties() method, which will be displayed in the Conversion tab as well.

The column types that the column converter supports are to be specified in the getSupportedColumnTypes() method.

For an example of a column converter, see the NrToJodaConverter class in the example given on Providing UI Converters from Plugins page.

...

An IColumnValidator can also define properties in the getDefaultProperties() method, whose values will be set by the developer in UI, in the Validation tab.

The column types that the validator supports are specified in the getSupportedColumnTypes() method.

All the implemented custom column validators must be returned by the getColumnValidators() method of the plugin class implementing the IColumnValidatorProvider interface, so that they become available within Servoy Developer.

...