D
- the descriptor for this value, e.g. VisitAttribute implements SingleCustomValuepublic 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()
The metadata describing this custom value
|
java.lang.Object |
getValue()
Convenience method to get the typed version of the serializedValue.
|
java.lang.String |
getValueReference() |
boolean |
isDirty() |
<T> void |
setValue(T typedValue)
Sets the typed value.
|
void |
setValueReferenceInternal(java.lang.String valueToPersist)
Directly set the String value that OpenMRS should persist in the database
in a varchar column.
|
D getDescriptor()
java.lang.String getValueReference() throws NotYetPersistedException
NotYetPersistedException
- if valueReference hasn't been set by the CustomDatatype yetvoid setValueReferenceInternal(java.lang.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
java.lang.Object getValue() throws InvalidCustomValueException
CustomDatatype.fromReferenceString(String)
.)InvalidCustomValueException
<T> void setValue(T typedValue) throws InvalidCustomValueException
CustomDatatype#toReferenceString(Object)
typedValue
- InvalidCustomValueException
boolean isDirty()
CustomDatatype.save(Object, String)
needs to be calledCopyright © 2018 OpenMRS Inc.. All Rights Reserved.