org.beanfabrics.model
Class BooleanPM
java.lang.Object
org.beanfabrics.AbstractBean
org.beanfabrics.ValidatableBean
org.beanfabrics.model.AbstractPM
org.beanfabrics.model.AbstractValuePM
org.beanfabrics.model.TextPM
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
.
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
BooleanPM
public BooleanPM()
- Constructs a BooleanPM.
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