@Component public class LongFreeTextDatatype extends java.lang.Object implements CustomDatatype<java.lang.String>
CustomDatatype.Summary
Constructor and Description |
---|
LongFreeTextDatatype() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
fromReferenceString(java.lang.String referenceString)
Converts a reference string to its typed value.
|
java.lang.String |
getReferenceStringForValue(java.lang.String typedValue)
Gets the reference string that would be persisted for the given typed value.
|
CustomDatatype.Summary |
getTextSummary(java.lang.String referenceString)
Converts a reference string to a short (generally < 100 characters) plain-text representation of its value.
|
java.lang.String |
save(java.lang.String typedValue,
java.lang.String existingValueReference)
The OpenMRS service layer calls this method when a custom value of this datatype is saved (created or edited).
|
void |
setConfiguration(java.lang.String config)
A
CustomValueDescriptor defines both a datatype and its configuration (e.g. |
void |
validate(java.lang.String typedValue)
Validates the given value to see if it is a legal value for the given handler.
|
public void setConfiguration(java.lang.String config)
CustomDatatype
CustomValueDescriptor
defines both a datatype and its configuration (e.g. a regex for a RegexValidatedString datatype).
The framework will instantiate datatypes and call this method to set that configuration. Subclasses should define the format
of this configuration.setConfiguration
in interface CustomDatatype<java.lang.String>
CustomDatatype.setConfiguration(java.lang.String)
public java.lang.String save(java.lang.String typedValue, java.lang.String existingValueReference) throws InvalidCustomValueException
CustomDatatype
save
in interface CustomDatatype<java.lang.String>
existingValueReference
- If null, the custom value is being saved for the first time. If not null, this custom value has
been saved before with the given reference. Implementations may choose to return the same value reference if they are overwriting
the old value on remote storage.InvalidCustomValueException
CustomDatatype.save(java.lang.Object, java.lang.String)
public java.lang.String getReferenceStringForValue(java.lang.String typedValue) throws java.lang.UnsupportedOperationException
CustomDatatype
getReferenceStringForValue
in interface CustomDatatype<java.lang.String>
java.lang.UnsupportedOperationException
- if it is not feasible to calculate this efficiently (e.g. you'd need to go to remote storage)CustomDatatype.getReferenceStringForValue(java.lang.Object)
public java.lang.String fromReferenceString(java.lang.String referenceString) throws InvalidCustomValueException
CustomDatatype
fromReferenceString
in interface CustomDatatype<java.lang.String>
InvalidCustomValueException
- if the persisted value is illegal (perhaps because datatype configuration
was changed since this value was persisted)CustomDatatype.fromReferenceString(java.lang.String)
public CustomDatatype.Summary getTextSummary(java.lang.String referenceString)
CustomDatatype
getTextSummary
in interface CustomDatatype<java.lang.String>
CustomDatatype.getTextSummary(java.lang.String)
public void validate(java.lang.String typedValue) throws InvalidCustomValueException
CustomDatatype
validate
in interface CustomDatatype<java.lang.String>
InvalidCustomValueException
CustomDatatype.validate(java.lang.Object)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.