org.beanfabrics.model
Class IntegerPM

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.BigDecimalPM
                          extended by org.beanfabrics.model.IntegerPM
All Implemented Interfaces:
Bean, ContextOwner, HasComparable, IBigDecimalPM, IIntegerPM, ITextPM, IValuePM, PresentationModel, Supportable, Validatable

public class IntegerPM
extends BigDecimalPM
implements IIntegerPM

The IntegerPM is a presentation model for integer numbers. The default range for valid numbers is between Long.MIN_VALUE and Long.MAX_VALUE.


Nested Class Summary
 class IntegerPM.IntegerValidationRule
           
 
Nested classes/interfaces inherited from class org.beanfabrics.model.BigDecimalPM
BigDecimalPM.BigDecimalComparable, BigDecimalPM.BigDecimalValidationRule, BigDecimalPM.Format
 
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_MESSAGE_INVALID_NUMBER
           
protected static java.lang.String KEY_MESSAGE_VALUE_TOO_BIG
           
protected static java.lang.String KEY_MESSAGE_VALUE_TOO_SMALL
           
 
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
IntegerPM()
           
IntegerPM(java.lang.Integer value)
           
 
Method Summary
 java.lang.Byte getByte()
          Returns the value of this PM as a Byte.
 java.lang.Integer getInteger()
          Returns the value of this PM as an Integer.
 java.lang.Long getLong()
          Returns the value of this PM as a Long.
 long getMaxValue()
          Returns the maximum numeric value that is valid for this PM's value.
 long getMinValue()
          Returns the minimum numeric value that is valid for this PM's value.
 java.lang.Short getShort()
          Returns the value of this PM as a Short.
 void setByte(java.lang.Byte value)
          Sets the value if this PM to the given Byte.
 void setInteger(java.lang.Integer value)
          Sets the value of this PM to the given Integer.
 void setLong(java.lang.Long value)
          Sets the value of this PM to the given Long.
 void setMaxValue(long maxValue)
          Sets the maximum numeric long value that is valid for this PM's value.
 void setMinMaxValueRange(long minValue, long maxValue)
           
 void setMinValue(long minValue)
          Sets the minimum numeric long value that is valid for this PM's value.
 void setShort(java.lang.Short value)
          Sets the value of this PM to the given Short.
 
Methods inherited from class org.beanfabrics.model.BigDecimalPM
createDefaultFormat, getBigDecimal, getBigInteger, getComparable, getDecimalFormat, getFormat, reformat, setBigDecimal, setBigInteger, setDefaultBigDecimal, setDefaultBigInteger, setFormat
 
Methods inherited from class org.beanfabrics.model.TextPM
getDefaultText, getOptions, getText, getText, isEmpty, isModified, isRestrictedToOptions, preset, 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.IIntegerPM
getBigInteger, setBigInteger
 
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_MESSAGE_VALUE_TOO_SMALL

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

KEY_MESSAGE_VALUE_TOO_BIG

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

KEY_MESSAGE_INVALID_NUMBER

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

IntegerPM

public IntegerPM()

IntegerPM

public IntegerPM(java.lang.Integer value)
Method Detail

getMinValue

public long getMinValue()
Description copied from interface: IIntegerPM
Returns the minimum numeric value that is valid for this PM's value.

Implementors must ensure that the validation of this PM should evaluate to invalid if the numeric value of this PM is less than the specified minimum value.

Specified by:
getMinValue in interface IIntegerPM
Returns:
the minimum numeric value

setMinValue

public void setMinValue(long minValue)
Description copied from interface: IIntegerPM
Sets the minimum numeric long value that is valid for this PM's value.

Specified by:
setMinValue in interface IIntegerPM
Parameters:
minValue - the minimum value
See Also:
IIntegerPM.getMinValue()

getMaxValue

public long getMaxValue()
Description copied from interface: IIntegerPM
Returns the maximum numeric value that is valid for this PM's value.

Implementors must ensure that the validation of this PM should evaluate to invalid if the numeric value of this PM is greater than the specified maximum value.

Specified by:
getMaxValue in interface IIntegerPM
Returns:
the maximum numeric value

setMaxValue

public void setMaxValue(long maxValue)
Description copied from interface: IIntegerPM
Sets the maximum numeric long value that is valid for this PM's value.

Specified by:
setMaxValue in interface IIntegerPM
Parameters:
maxValue - the maximum value
See Also:
IIntegerPM.getMaxValue()

setMinMaxValueRange

public void setMinMaxValueRange(long minValue,
                                long maxValue)

setByte

public void setByte(java.lang.Byte value)
Description copied from interface: IIntegerPM
Sets the value if this PM to the given Byte.

Specified by:
setByte in interface IIntegerPM
Parameters:
value - the Byte value

getByte

public java.lang.Byte getByte()
                       throws ConversionException
Description copied from interface: IIntegerPM
Returns the value of this PM as a Byte.

Specified by:
getByte in interface IIntegerPM
Returns:
the value of this PM as a Byte
Throws:
ConversionException - if the text value of this PM cannot be converted to a Byte

setShort

public void setShort(java.lang.Short value)
Description copied from interface: IIntegerPM
Sets the value of this PM to the given Short.

Specified by:
setShort in interface IIntegerPM
Parameters:
value - the Short value

getShort

public java.lang.Short getShort()
                         throws ConversionException
Description copied from interface: IIntegerPM
Returns the value of this PM as a Short.

Specified by:
getShort in interface IIntegerPM
Returns:
the value of this PM as a Short
Throws:
ConversionException - if the text value of this PM cannot be converted to a Short

setInteger

public void setInteger(java.lang.Integer value)
Description copied from interface: IIntegerPM
Sets the value of this PM to the given Integer.

Specified by:
setInteger in interface IIntegerPM
Parameters:
value - the Integer value

getInteger

public java.lang.Integer getInteger()
                             throws ConversionException
Description copied from interface: IIntegerPM
Returns the value of this PM as an Integer.

Specified by:
getInteger in interface IIntegerPM
Returns:
the value of this PM as an Integer
Throws:
ConversionException - if the text value of this PM cannot be converted to an Integer

setLong

public void setLong(java.lang.Long value)
Description copied from interface: IIntegerPM
Sets the value of this PM to the given Long.

Specified by:
setLong in interface IIntegerPM
Parameters:
value - the Long value

getLong

public java.lang.Long getLong()
                       throws ConversionException
Description copied from interface: IIntegerPM
Returns the value of this PM as a Long.

Specified by:
getLong in interface IIntegerPM
Returns:
the value of this PM as a Long
Throws:
ConversionException - if the text value of this PM cannot be converted to a Long