D
- the descriptor for this value, e.g. VisitAttribute implements SingleCustomValue<VisitAttributeType>public interface SingleCustomValue<D extends CustomValueDescriptor>
GlobalProperty
) or a single custom value within a Customizable
object that may hold multiple (e.g. a VisitAttribute
within a Visit
).
The "referenceString" property is a String suitable for persistance in a database varchar column. It is typically a
reference to the real value (e.g. it is the UUID of a location or the URI of an image in a PACS).
The "objectValue" property accessors are convenience methods that use a CustomDatatype
to convert
to/from the String serializedValue.CustomDatatype
Modifier and Type | Method and Description |
---|---|
D |
getDescriptor() |
Object |
getValue()
Convenience method to get the typed version of the serializedValue.
|
String |
getValueReference() |
boolean |
isDirty() |
<T> void |
setValue(T typedValue)
Sets the typed value.
|
void |
setValueReferenceInternal(String valueToPersist)
Directly set the String value that OpenMRS should persist in the database
in a varchar column.
|
D getDescriptor()
String getValueReference() throws NotYetPersistedException
NotYetPersistedException
- if valueReference hasn't been set by the CustomDatatype yetvoid setValueReferenceInternal(String valueToPersist) throws InvalidCustomValueException
InvalidCustomValueException
if it's invalid, rather than setting it blindly.
If you are coding against the OpenMRS API, you should use setValue(Object)
instead.valueToPersist
- InvalidCustomValueException
Object getValue() throws InvalidCustomValueException
CustomDatatype.fromReferenceString(String)
.)InvalidCustomValueException
<T> void setValue(T typedValue) throws InvalidCustomValueException
CustomDatatype.getReferenceStringForValue(Object)
typedValue
- InvalidCustomValueException
boolean isDirty()
CustomDatatype.save(Object, String)
needs to be calledCopyright © 2024 OpenMRS Inc.. All rights reserved.