Class DataTypeService
- java.lang.Object
-
- gov.nist.secauto.metaschema.core.datatype.DataTypeService
-
public final class DataTypeService extends Object
This class provides a singleton service to allow data types to be discovered within the system based on an SPI provided byIDataTypeProvider
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataTypeService
getInstance()
Get the singleton service instance, which will be lazy constructed on first access.<TYPE extends IDataTypeAdapter<?>>
TYPEgetJavaTypeAdapterByClass(Class<TYPE> clazz)
Lookup a specificIDataTypeAdapter
instance by its class.IDataTypeAdapter<?>
getJavaTypeAdapterByName(String name)
Lookup a specificIDataTypeAdapter
instance by its name.
-
-
-
Method Detail
-
getInstance
@NonNull public static DataTypeService getInstance()
Get the singleton service instance, which will be lazy constructed on first access.- Returns:
- the service instance
-
getJavaTypeAdapterByName
@Nullable public IDataTypeAdapter<?> getJavaTypeAdapterByName(@NonNull String name)
Lookup a specificIDataTypeAdapter
instance by its name.- Parameters:
name
- the data type name of data type adapter to get the instance for- Returns:
- the instance or
null
if the instance is unknown to the type system
-
getJavaTypeAdapterByClass
@Nullable public <TYPE extends IDataTypeAdapter<?>> TYPE getJavaTypeAdapterByClass(@NonNull Class<TYPE> clazz)
Lookup a specificIDataTypeAdapter
instance by its class.- Type Parameters:
TYPE
- the type of the requested adapter- Parameters:
clazz
- the adapter class to get the instance for- Returns:
- the instance or
null
if the instance is unknown to the type system
-
-