public class CustomDatatypeUtil
extends java.lang.Object
Constructor and Description |
---|
CustomDatatypeUtil() |
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.String,java.lang.String> |
deserializeSimpleConfiguration(java.lang.String serializedConfig)
Deserializes a simple String-based configuration from the serialized form used by
serializeSimpleConfiguration
Utility method for AttributeHandler s that have property-style configuration. |
static CustomDatatype<?> |
getDatatype(CustomValueDescriptor descriptor) |
static CustomDatatype<?> |
getDatatype(java.lang.String datatypeClassname,
java.lang.String datatypeConfig) |
static java.util.List<java.lang.String> |
getDatatypeClassnames() |
static CustomDatatype<?> |
getDatatypeOrDefault(CustomValueDescriptor descriptor) |
static CustomDatatypeHandler |
getHandler(CustomDatatype<?> dt,
java.lang.String preferredHandlerClassname,
java.lang.String handlerConfig) |
static CustomDatatypeHandler |
getHandler(CustomValueDescriptor descriptor) |
static java.util.List<java.lang.String> |
getHandlerClassnames() |
static <T extends AttributeType<?>,U> |
getValueReferences(java.util.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 java.lang.String |
serializeSimpleConfiguration(java.util.Map<java.lang.String,java.lang.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(java.lang.String datatypeClassname, java.lang.String datatypeConfig)
datatypeClassname
- datatypeConfig
- public static CustomDatatype<?> getDatatypeOrDefault(CustomValueDescriptor descriptor)
descriptor
- public static CustomDatatypeHandler getHandler(CustomValueDescriptor descriptor)
descriptor
- public static CustomDatatypeHandler getHandler(CustomDatatype<?> dt, java.lang.String preferredHandlerClassname, java.lang.String handlerConfig)
dt
- the datatype that this handler should be forpreferredHandlerClassname
- handlerConfig
- public static java.lang.String serializeSimpleConfiguration(java.util.Map<java.lang.String,java.lang.String> simpleConfig)
AttributeHandler
s that have property-style configuration.simpleConfig
- public static java.util.Map<java.lang.String,java.lang.String> deserializeSimpleConfiguration(java.lang.String serializedConfig)
serializeSimpleConfiguration
Utility method for AttributeHandler
s that have property-style configuration.serializedConfig
- public static <T extends AttributeType<?>,U> java.util.Map<T,java.lang.String> getValueReferences(java.util.Map<T,U> datatypeValues)
datatypeValues
- public static java.util.List<java.lang.String> getDatatypeClassnames()
public static java.util.List<java.lang.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 © 2018 OpenMRS Inc.. All Rights Reserved.