Class ObjectBooleanConverter

java.lang.Object
org.zkoss.bind.converter.ObjectBooleanConverter
All Implemented Interfaces:
Serializable, Converter

public class ObjectBooleanConverter extends Object implements Converter, Serializable
Converter to convert boolean to Object.
Since:
6.0.0
Author:
henrichen
See Also:
  • Constructor Details

    • ObjectBooleanConverter

      public ObjectBooleanConverter()
  • Method Details

    • coerceToBean

      public Object coerceToBean(Object val, org.zkoss.zk.ui.Component comp, BindContext ctx)
      Given an object value and return whether it is a "true" object.
      Specified by:
      coerceToBean in interface Converter
      Parameters:
      val - the object to be checked if a true object
      comp - associated Component
      ctx - bind context for associate Binding and extra parameter (e.g. true and false)
      Returns:
      the converted Boolean object
    • coerceToUi

      public Object coerceToUi(Object val, org.zkoss.zk.ui.Component comp, BindContext ctx)
      Given a Boolean value and return associated "true" object if true; or "false" object if null or false
      Specified by:
      coerceToUi in interface Converter
      Parameters:
      val - the boolean value to be checked.
      comp - associate Component
      ctx - bind context for associate Binding and extra parameter (e.g. true and false)
      Returns:
      the converted "true" object if true; or "false" object if null or false.