org.kuali.rice.krad.web.bind
Class UifBooleanEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by 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:
Serialized Form

Constructor Summary
UifBooleanEditor()
           
 
Method Summary
 String getAsText()
          Gets the property value as a string suitable for presentation to a human to edit
 void setAsText(String text)
          Sets the property value by parsing a given String
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UifBooleanEditor

public UifBooleanEditor()
Method Detail

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


Copyright © 2005-2014 The Kuali Foundation. All Rights Reserved.