org.beanfabrics.model
Class BigDecimalPM

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
All Implemented Interfaces:
Bean, ContextOwner, IBigDecimalPM, ITextPM, IValuePM, PresentationModel, Supportable, Validatable
Direct Known Subclasses:
DecimalPM, IntegerPM, MoneyPM

public class BigDecimalPM
extends TextPM
implements IBigDecimalPM

The BigDecimalPM is a presentation model for a BigDecimal value. It is the base class for all other 'numeric' presentation models.

Author:
Michael Karneim

Nested Class Summary
 class BigDecimalPM.DefaultValidationRule
           
 
Nested classes/interfaces inherited from class org.beanfabrics.model.TextPM
TextPM.DefaultOptionsValidationRule, TextPM.TextComparable
 
Nested classes/interfaces inherited from class org.beanfabrics.model.AbstractPM
AbstractPM.PropertiesValidationRule
 
Field Summary
 
Fields inherited from class org.beanfabrics.model.TextPM
KEY_MESSAGE_VALUE_NOT_AN_OPTION
 
Constructor Summary
BigDecimalPM()
           
 
Method Summary
protected  java.text.DecimalFormat createDefaultFormat()
           
 java.math.BigDecimal getBigDecimal()
           
 java.math.BigInteger getBigInteger()
           
 java.lang.Comparable getComparable()
           
static java.text.DecimalFormat getDecimalFormat(java.util.Locale locale)
           
 java.text.DecimalFormat getFormat()
          Returns the format.
 void reformat()
          Parses the content and formats it according to this model's format.
 void setBigDecimal(java.math.BigDecimal value)
           
 void setBigInteger(java.math.BigInteger value)
           
 void setDefaultBigDecimal(java.math.BigDecimal value)
           
 void setDefaultBigInteger(java.math.BigInteger value)
           
 void setFormat(java.text.DecimalFormat newFormat)
          Sets the format of this model.
 
Methods inherited from class org.beanfabrics.model.TextPM
getDefaultText, getOptions, getText, getText, isEmpty, isModified, isRestrictedToOptions, preset, reset, setDefaultText, setOptions, setRestrictedToOptions, setText, toString
 
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
createPropertiesValidationRule, 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, wait, wait, wait
 
Methods inherited from interface org.beanfabrics.model.ITextPM
getOptions, getText, isModified, preset, 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
 

Constructor Detail

BigDecimalPM

public BigDecimalPM()
Method Detail

reformat

public void reformat()
Parses the content and formats it according to this model's format.

Specified by:
reformat in interface ITextPM
Overrides:
reformat in class TextPM
See Also:
setFormat(DecimalFormat)

createDefaultFormat

protected java.text.DecimalFormat createDefaultFormat()

getDecimalFormat

public static java.text.DecimalFormat getDecimalFormat(java.util.Locale locale)

getFormat

public java.text.DecimalFormat getFormat()
Returns the format.

Returns:
the format
See Also:
reformat()

setFormat

public void setFormat(java.text.DecimalFormat newFormat)
Sets the format of this model. The format will be cloned prior use.

Parameters:
newFormat - the new format for this model
See Also:
reformat()

setBigDecimal

public void setBigDecimal(java.math.BigDecimal value)
Specified by:
setBigDecimal in interface IBigDecimalPM

getBigDecimal

public java.math.BigDecimal getBigDecimal()
                                   throws ConversionException
Specified by:
getBigDecimal in interface IBigDecimalPM
Throws:
ConversionException

setDefaultBigDecimal

public void setDefaultBigDecimal(java.math.BigDecimal value)

setBigInteger

public void setBigInteger(java.math.BigInteger value)

getBigInteger

public java.math.BigInteger getBigInteger()
                                   throws ConversionException
Throws:
ConversionException

setDefaultBigInteger

public void setDefaultBigInteger(java.math.BigInteger value)

getComparable

public java.lang.Comparable getComparable()
Specified by:
getComparable in interface IValuePM
Overrides:
getComparable in class TextPM


© 2010 by Michael Karneim, http://www.beanfabrics.org