org.beanfabrics.model
Class BooleanPM

java.lang.Object
  extended by org.beanfabrics.AbstractBean
      extended by org.beanfabrics.ValidatableBean
          extended by org.beanfabrics.model.AbstractPM
              extended by org.beanfabrics.model.AbstractValuePM
                  extended by org.beanfabrics.model.TextPM
                      extended by org.beanfabrics.model.BooleanPM
All Implemented Interfaces:
Bean, ContextOwner, HasComparable, IBooleanPM, ITextPM, IValuePM, PresentationModel, Supportable, Validatable

public class BooleanPM
extends TextPM
implements IBooleanPM

The BooleanPM is a PresentationModel that contains a Boolean value.

The default value is Boolean.FALSE.

The text representation of the boolean value is localized depending on the default Locale.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.beanfabrics.model.TextPM
TextPM.DefaultOptionsValidationRule, TextPM.TextComparable
 
Nested classes/interfaces inherited from class org.beanfabrics.model.AbstractValuePM
AbstractValuePM.MandatoryValidationRule
 
Nested classes/interfaces inherited from class org.beanfabrics.model.AbstractPM
AbstractPM.PropertiesValidationRule
 
Field Summary
protected static java.lang.String KEY_TEXT_FALSE
           
protected static java.lang.String KEY_TEXT_TRUE
           
 
Fields inherited from class org.beanfabrics.model.TextPM
KEY_MESSAGE_VALUE_NOT_AN_OPTION
 
Fields inherited from class org.beanfabrics.model.AbstractValuePM
KEY_MESSAGE_MANDATORY
 
Fields inherited from class org.beanfabrics.model.AbstractPM
KEY_MESSAGE_ONE_OR_MORE_INVALID
 
Constructor Summary
BooleanPM()
          Constructs a BooleanPM.
 
Method Summary
protected  Options<java.lang.Boolean> createDefaultOptions()
          Creates the default Options attribute of this PM.
 java.lang.Boolean getBoolean()
          Returns the value of this PM as a Boolean.
 void setBoolean(java.lang.Boolean b)
          Sets the value of this PM to the given value.
 void setDefaultBoolean(java.lang.Boolean value)
          Sets the default value of this PM to the given Boolean value.
 
Methods inherited from class org.beanfabrics.model.TextPM
getComparable, getDefaultText, getOptions, getText, getText, isEmpty, isModified, isRestrictedToOptions, preset, reformat, reset, setDefaultText, setOptions, setRestrictedToOptions, setText
 
Methods inherited from class org.beanfabrics.model.AbstractValuePM
getDescription, getTitle, isEditable, isMandatory, revalidate, setDescription, setEditable, setMandatory, setTitle
 
Methods inherited from class org.beanfabrics.model.AbstractPM
getContext, getSupportMap, revalidateProperties
 
Methods inherited from class org.beanfabrics.ValidatableBean
getValidationState, getValidator, isValid, setValidationState
 
Methods inherited from class org.beanfabrics.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, equals, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.beanfabrics.model.ITextPM
getOptions, getText, isModified, preset, reformat, reset, setOptions, setText
 
Methods inherited from interface org.beanfabrics.model.IValuePM
getDescription, getTitle, isEditable, isEmpty, isMandatory, setDescription, setEditable, setMandatory, setTitle
 
Methods inherited from interface org.beanfabrics.Bean
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface org.beanfabrics.validation.Validatable
getValidationState, getValidator, isValid, revalidate
 
Methods inherited from interface org.beanfabrics.support.Supportable
getSupportMap
 
Methods inherited from interface org.beanfabrics.context.ContextOwner
getContext
 
Methods inherited from interface org.beanfabrics.HasComparable
getComparable
 

Field Detail

KEY_TEXT_TRUE

protected static final java.lang.String KEY_TEXT_TRUE
See Also:
Constant Field Values

KEY_TEXT_FALSE

protected static final java.lang.String KEY_TEXT_FALSE
See Also:
Constant Field Values
Constructor Detail

BooleanPM

public BooleanPM()
Constructs a BooleanPM.

Method Detail

setBoolean

public void setBoolean(java.lang.Boolean b)
Sets the value of this PM to the given value.

Specified by:
setBoolean in interface IBooleanPM
Parameters:
b - the new value.
See Also:
ITextPM.setText(String)

getBoolean

public java.lang.Boolean getBoolean()
                             throws ConversionException
Returns the value of this PM as a Boolean.

Specified by:
getBoolean in interface IBooleanPM
Returns:
the value of this PM as a Boolean
Throws:
ConversionException - if the text value can't be converted into a valid Boolean

setDefaultBoolean

public void setDefaultBoolean(java.lang.Boolean value)
Sets the default value of this PM to the given Boolean value.

Parameters:
value -

createDefaultOptions

protected Options<java.lang.Boolean> createDefaultOptions()
Creates the default Options attribute of this PM. The method is called from the constructor.

Returns:
the default Options