Class UifBooleanEditor

java.lang.Object
java.beans.PropertyEditorSupport
org.kuali.rice.krad.web.bind.UifBooleanEditor
All Implemented Interfaces:
PropertyEditor, Serializable

public class UifBooleanEditor extends PropertyEditorSupport implements Serializable
PropertyEditor for booleans supports y/n which the spring version does not
Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Constructor Details

    • UifBooleanEditor

      public UifBooleanEditor()
  • Method Details

    • getAsText

      public String getAsText()
      Gets the property value as a string suitable for presentation to a human to edit
      Specified by:
      getAsText in interface PropertyEditor
      Overrides:
      getAsText in class PropertyEditorSupport
      Returns:
      The property value as a string suitable for presentation to a human to edit.

      Returns String "true" or "false".

      Returns "null" is the value can't be expressed as a string.

      If a non-null value is returned, then the PropertyEditor should be prepared to parse that string back in setAsText().

    • setAsText

      public void setAsText(String text) throws IllegalArgumentException
      Sets the property value by parsing a given String

      The text is compared against the configured acceptable string values for boolean true and false

      Specified by:
      setAsText in interface PropertyEditor
      Overrides:
      setAsText in class PropertyEditorSupport
      Parameters:
      text - The string to be parsed.
      Throws:
      IllegalArgumentException - if text does not contain either true or false