public class CustomDatatypeUtil extends Object
Modifier and Type | Method and Description |
---|---|
static Map<String,String> |
deserializeSimpleConfiguration(String serializedConfig)
Deserializes a simple String-based configuration from the serialized form used by
serializeSimpleConfiguration(Map)
Utility method for property-style configuration implementations. |
static CustomDatatype<?> |
getDatatype(CustomValueDescriptor descriptor) |
static CustomDatatype<?> |
getDatatype(String datatypeClassname,
String datatypeConfig) |
static List<String> |
getDatatypeClassnames() |
static CustomDatatype<?> |
getDatatypeOrDefault(CustomValueDescriptor descriptor) |
static CustomDatatypeHandler |
getHandler(CustomDatatype<?> dt,
String preferredHandlerClassname,
String handlerConfig) |
static CustomDatatypeHandler |
getHandler(CustomValueDescriptor descriptor) |
static List<String> |
getHandlerClassnames() |
static <T extends AttributeType<?>,U> |
getValueReferences(Map<T,U> datatypeValues)
Uses the appropriate datatypes to convert all values in the input map to their valueReference equivalents.
|
static boolean |
isCompatibleHandler(CustomDatatypeHandler handler,
CustomDatatype<?> datatype) |
static void |
saveAttributesIfNecessary(Customizable<?> customizable)
To be called by service save methods for customizable implementations.
|
static void |
saveIfDirty(SingleCustomValue<?> value)
Calls the save method on value's
ConceptDatatype if necessary |
static String |
serializeSimpleConfiguration(Map<String,String> simpleConfig)
Converts a simple String-based configuration to a serialized form.
|
static <T,D extends CustomValueDescriptor> |
validate(SingleCustomValue<D> value)
Validates a
SingleCustomValue |
public static CustomDatatype<?> getDatatype(CustomValueDescriptor descriptor)
descriptor
- public static CustomDatatype<?> getDatatype(String datatypeClassname, String datatypeConfig)
datatypeClassname
- datatypeConfig
- public static CustomDatatype<?> getDatatypeOrDefault(CustomValueDescriptor descriptor)
descriptor
- public static CustomDatatypeHandler getHandler(CustomValueDescriptor descriptor)
descriptor
- public static CustomDatatypeHandler getHandler(CustomDatatype<?> dt, String preferredHandlerClassname, String handlerConfig)
dt
- the datatype that this handler should be forpreferredHandlerClassname
- handlerConfig
- public static String serializeSimpleConfiguration(Map<String,String> simpleConfig)
simpleConfig
- public static Map<String,String> deserializeSimpleConfiguration(String serializedConfig)
serializeSimpleConfiguration(Map)
Utility method for property-style configuration implementations.serializedConfig
- public static <T extends AttributeType<?>,U> Map<T,String> getValueReferences(Map<T,U> datatypeValues)
datatypeValues
- public static List<String> getDatatypeClassnames()
public static List<String> getHandlerClassnames()
public static boolean isCompatibleHandler(CustomDatatypeHandler handler, CustomDatatype<?> datatype)
handler
- datatype
- public static void saveAttributesIfNecessary(Customizable<?> customizable)
ConceptDatatype
for any dirty ones.customizable
- public static void saveIfDirty(SingleCustomValue<?> value)
ConceptDatatype
if necessaryvalue
- public static <T,D extends CustomValueDescriptor> boolean validate(SingleCustomValue<D> value)
SingleCustomValue
value
- Copyright © 2024 OpenMRS Inc.. All rights reserved.