public class RegExpConverter extends AbstractTypeConverter<String,String> implements TypeConverter<String,String>
Note that by default the RegExpConverter blocks values that don't match its pattern and doesn't pass them through (both directions).
| Constructor and Description |
|---|
RegExpConverter(ValueModel<String> pSubject,
String pRegExp)
Create a new converter with the handed subject.
|
RegExpConverter(ValueModel<String> pSubject,
String pRegExp,
boolean pBlockValue)
Create a new converter with the handed subject.
|
| Modifier and Type | Method and Description |
|---|---|
String |
convertOwnToSubjectValue(String pOwnValue)
Converts from the type that this value model offers to the type
of the subject value model.
|
String |
convertSubjectToOwnValue(String pSubjectValue)
Converts from the type that the subject value model provides
to the type this value model offers
|
boolean |
getBlockValue() |
void |
setBlockValue(boolean pBlockValue)
sets the block behavious
|
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 RegExpConverter(ValueModel<String> pSubject, String pRegExp)
pSubject - the ValueModel holding the original value, must not be nullpRegExp - the regular expression we should use for formatting/parsingIllegalArgumentException - if pSubject or pRegExp is null or pRegExp is not validpublic RegExpConverter(ValueModel<String> pSubject, String pRegExp, boolean pBlockValue)
pSubject - the ValueModel holding the original value, must not be nullpRegExp - the regular expression we should use for formatting/parsingpBlockValue - if true, values are blocked if they don't match the regexp,
if false, they are propagatedIllegalArgumentException - if pSubject or pRegExp is null or pRegExp is not validpublic boolean getBlockValue()
public void setBlockValue(boolean pBlockValue)
pBlockValue - if true, values are blocked if they don't match the regexp,
if false, they are propagatedpublic String convertSubjectToOwnValue(String pSubjectValue) throws ConversionException
convertSubjectToOwnValue in interface TypeConverter<String,String>pSubjectValue - value in the subject's typeConversionException - if we detected an error during the conversionpublic String convertOwnToSubjectValue(String pOwnValue) throws ConversionException
convertOwnToSubjectValue in interface TypeConverter<String,String>pOwnValue - value in this value model's typeConversionException - if we detected an error during the conversionCopyright © 2017 Jürgen Zeller (privat). All rights reserved.