@Component public class RegexValidatedTextDatatype extends SerializingCustomDatatype<String>
CustomDatatype.Summary
Constructor and Description |
---|
RegexValidatedTextDatatype() |
Modifier and Type | Method and Description |
---|---|
String |
deserialize(String serializedValue) |
String |
serialize(String typedValue) |
void |
setConfiguration(String regex)
Does nothing in the default implementation
|
void |
validate(String typedValue)
Passes for all non-null values in the default implementation
|
doGetTextSummary, fromReferenceString, getReferenceStringForValue, getTextSummary, save
public void setConfiguration(String regex)
SerializingCustomDatatype
setConfiguration
in interface CustomDatatype<String>
setConfiguration
in class SerializingCustomDatatype<String>
CustomDatatype.setConfiguration(java.lang.String)
public String serialize(String typedValue)
serialize
in class SerializingCustomDatatype<String>
typedValue
- (has already had validate called)Should fail if the string does not match the regex
public String deserialize(String serializedValue)
deserialize
in class SerializingCustomDatatype<String>
SerializingCustomDatatype.deserialize(java.lang.String)
public void validate(String typedValue) throws InvalidCustomValueException
SerializingCustomDatatype
validate
in interface CustomDatatype<String>
validate
in class SerializingCustomDatatype<String>
InvalidCustomValueException
Should accept a string that matches the regex
Should fail if the string does not match the regex
Copyright © 2024 OpenMRS Inc.. All rights reserved.