public class BigDecimalStringConverter extends AbstractTypeConverter<String,BigDecimal> implements TypeConverter<String,BigDecimal>
| Constructor and Description |
|---|
BigDecimalStringConverter(ValueModel<BigDecimal> pSubject)
Create a new BigDecimal-to-String converter where null is a valid value.
|
BigDecimalStringConverter(ValueModel<BigDecimal> pSubject,
boolean pNullIsValid)
Create a new BigDecimal-to-String converter.
|
BigDecimalStringConverter(ValueModel<BigDecimal> pSubject,
NumberFormat pFormat)
Create a new BigDecimal-to-String converter where null is a valid value.
|
BigDecimalStringConverter(ValueModel<BigDecimal> pSubject,
NumberFormat pFormat,
boolean pNullIsValid)
Create a new BigDecimal-to-String converter.
|
| Modifier and Type | Method and Description |
|---|---|
BigDecimal |
convertOwnToSubjectValue(String pOwnValue)
Converts from a String to an BigDecimal.
|
String |
convertSubjectToOwnValue(BigDecimal pSubjectValue)
Converts from a BigDecimal to a String.
|
void |
setNullSubstitute(BigDecimal pNullSubstitute)
Method to set the BigDecimal null subsitute.
|
dispose, getPropagateFailedConversions, getSubject, getSubjectValue, getSyncKey, getSyncMessage, getSyncState, getValue, getValue, isEditable, setPropagateFailedConversions, setSyncKey, setSyncMessage, setValue, stateChangedaddChangeListener, booleanValue, checkDisposed, doubleValue, fireStateChanged, floatValue, getDependents, getName, intValue, isDisposed, isInSetValue, isSetForced, longValue, onChangeSend, removeChangeListener, retractInterestsFor, setInSetValue, setName, setObjectValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueForced, signalExternalUpdate, stringValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSyncKey, getSyncMessage, getSyncState, setSyncKey, setSyncMessageaddChangeListener, booleanValue, dispose, doubleValue, floatValue, getDependents, getName, getValue, intValue, isDisposed, isEditable, isSetForced, longValue, onChangeSend, removeChangeListener, retractInterestsFor, setName, setObjectValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueForced, stringValuepublic BigDecimalStringConverter(ValueModel<BigDecimal> pSubject)
pSubject - the ValueModel holding the original valuepublic BigDecimalStringConverter(ValueModel<BigDecimal> pSubject, boolean pNullIsValid)
pSubject - the ValueModel holding the original valuepNullIsValid - marker if we should use null as an
alternative value if the conversion failspublic BigDecimalStringConverter(ValueModel<BigDecimal> pSubject, NumberFormat pFormat)
pSubject - the ValueModel holding the original valuepFormat - the number formatter, may be nullpublic BigDecimalStringConverter(ValueModel<BigDecimal> pSubject, NumberFormat pFormat, boolean pNullIsValid)
pSubject - the ValueModel holding the original valuepFormat - the number formatter, may be nullpNullIsValid - marker if we should use null as an
alternative value if the conversion failspublic void setNullSubstitute(BigDecimal pNullSubstitute)
pNullSubstitute - null or any BigDecimalIllegalStateException - if null is not validpublic String convertSubjectToOwnValue(BigDecimal pSubjectValue) throws ConversionException
convertSubjectToOwnValue in interface TypeConverter<String,BigDecimal>pSubjectValue - value in the subject's type (BigDecimal)ConversionException - if we detected an error during the conversionpublic BigDecimal convertOwnToSubjectValue(String pOwnValue) throws ConversionException
convertOwnToSubjectValue in interface TypeConverter<String,BigDecimal>pOwnValue - value in this value model's type (String)ConversionException - if we detected an error during the conversionCopyright © 2017 Jürgen Zeller (privat). All rights reserved.