public class LongStringConverter extends AbstractNumberStringConverter<Long>
| Constructor and Description |
|---|
LongStringConverter(ValueModel<Long> pSubject)
Create a new Long-to-String converter where null is a valid value.
|
LongStringConverter(ValueModel<Long> pSubject,
boolean pNullIsValid)
Create a new Long-to-String converter.
|
| Modifier and Type | Method and Description |
|---|---|
protected Long |
convertToNumber(String pOwnValue)
convert the own string value to the number.
|
convertOwnToSubjectValue, convertSubjectToOwnValue, convertToString, getNullIsValid, setNullIsValid, setNullSubstitutedispose, 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 LongStringConverter(ValueModel<Long> pSubject)
pSubject - the ValueModel holding the original valuepublic LongStringConverter(ValueModel<Long> pSubject, boolean pNullIsValid)
pSubject - the ValueModel holding the original valuepNullIsValid - true if we should use null as an
alternative value if the conversion failsprotected Long convertToNumber(String pOwnValue) throws NumberFormatException
return new Integer( ownValue);
.
If the conversion is not possible, you can throw a NumberFormatException
which will be converted into a ConversionException with the correct
substitute values.convertToNumber in class AbstractNumberStringConverter<Long>pOwnValue - the value as a stringNumberFormatException - if the string value is not parsable into a numberCopyright © 2017 Jürgen Zeller (privat). All rights reserved.